Merge branch 'develop' into NEW_Employee_management_improvement
This commit is contained in:
commit
21090963e0
57
ChangeLog
57
ChangeLog
@ -3,6 +3,62 @@ English Dolibarr ChangeLog
|
|||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 16.0.0 compared to 15.0.0 *****
|
||||||
|
|
||||||
|
For users:
|
||||||
|
---------------
|
||||||
|
|
||||||
|
NEW: ...
|
||||||
|
|
||||||
|
|
||||||
|
Modules
|
||||||
|
NEW: Experimental module Event Organization Management
|
||||||
|
NEW: Experimental module Workstations Management
|
||||||
|
NEW: Experimental module Partnership Management
|
||||||
|
|
||||||
|
|
||||||
|
For developers:
|
||||||
|
---------------
|
||||||
|
|
||||||
|
NEW:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* verifCond('stringtoevaluate') now return false when string contains a bad syntax content instead of true.
|
||||||
|
* The deprecated mdethod thirdparty_doc_create() has been removed. You can use the generateDocument() instead.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 15.0.1 compared to 15.0.0 *****
|
||||||
|
FIX: #19777 #20281
|
||||||
|
FIX: bad position of extrafields for interventions
|
||||||
|
FIX: Blocking situation when a payment was deleted in bank.
|
||||||
|
FIX: creation of the shipment if order contains services
|
||||||
|
FIX: Drag and drop line of files on join files tab
|
||||||
|
FIX: Error management on mass action "Approve holiday"
|
||||||
|
FIX: error with php8
|
||||||
|
FIX: in case of VAT refund, negative amount must be allowed
|
||||||
|
FIX: invoice pdf: lines originating from deposits were not detailed anymore
|
||||||
|
FIX: Invoice - When you create an invoice for a given thirdparty, fk_account is not retrieved from company card
|
||||||
|
FIX: list of visible type of event was not correctly filtered
|
||||||
|
FIX: Missing or bad permissions
|
||||||
|
FIX: Missing the field date start/end in export supplier invoice/order
|
||||||
|
FIX: On large proposal or invoice, fix n(n+1) sql into a n sql.
|
||||||
|
FIX: options should not exists on invoices
|
||||||
|
FIX: payment not completed when using Paypal.
|
||||||
|
FIX: permission to download files of expense report with readall.
|
||||||
|
FIX- Preview icon in documents list PDF in the admin page third-party
|
||||||
|
FIX: shipping list, e.shipping_method_id should be e.fk_shipping_method.
|
||||||
|
FIX: Show product photo on Supplier order Cornas model.
|
||||||
|
FIX: User name in ManufacturingOrder
|
||||||
|
FIX: viewimage.php blocks requests with multicompany from other enties
|
||||||
|
FIX: #yogosha9048
|
||||||
|
FIX: #yogosha9054
|
||||||
|
FIX: #yogosha9095
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
@ -10,6 +66,7 @@ For users:
|
|||||||
|
|
||||||
NEW: Online proposal signature
|
NEW: Online proposal signature
|
||||||
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
|
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
|
||||||
|
NEW: Provide a special pages for bookmarks and multicompany for a better use of some mobile applications (like DoliDroid)
|
||||||
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
|
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
|
||||||
NEW: Add option to disable globaly some notifications emails.
|
NEW: Add option to disable globaly some notifications emails.
|
||||||
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
|
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
|
||||||
|
|||||||
@ -190,7 +190,7 @@ $arrayfields = array(
|
|||||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||||
@ -678,19 +678,28 @@ $formconfirm = '';
|
|||||||
if ($action == 'export_file') {
|
if ($action == 'export_file') {
|
||||||
$form_question = array();
|
$form_question = array();
|
||||||
|
|
||||||
|
// If 1 or not set, we check by default.
|
||||||
|
$checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE));
|
||||||
$form_question['notifiedexportdate'] = array(
|
$form_question['notifiedexportdate'] = array(
|
||||||
'name' => 'notifiedexportdate',
|
'name' => 'notifiedexportdate',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'label' => $langs->trans('NotifiedExportDate'),
|
'label' => $langs->trans('NotifiedExportDate'),
|
||||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'),
|
'value' => $checked,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$form_question['separator'] = array('name'=>'separator', 'type'=>'separator');
|
||||||
|
|
||||||
|
// If 0 or not set, we NOT check by default.
|
||||||
|
$checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE));
|
||||||
$form_question['notifiedvalidationdate'] = array(
|
$form_question['notifiedvalidationdate'] = array(
|
||||||
'name' => 'notifiedvalidationdate',
|
'name' => 'notifiedvalidationdate',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'label' => $langs->trans('NotifiedValidationDate'),
|
'label' => $langs->trans('NotifiedValidationDate'),
|
||||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
'value' => $checked,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator');
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -823,7 +832,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
|
|||||||
// Code journal
|
// Code journal
|
||||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150');
|
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth150');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Date document
|
// Date document
|
||||||
@ -845,10 +854,10 @@ if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
|||||||
if (!empty($arrayfields['t.numero_compte']['checked'])) {
|
if (!empty($arrayfields['t.numero_compte']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200', 'account');
|
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth150', 'account');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200', 'account');
|
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth150', 'account');
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1125,24 +1134,25 @@ while ($i < min($num, $limit)) {
|
|||||||
// Other type
|
// Other type
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td class="nowrap">';
|
$labeltoshow = '';
|
||||||
|
$labeltoshowalt = '';
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
|
||||||
// Picto + Ref
|
|
||||||
print '<td class="nobordernopadding nowrap">';
|
|
||||||
|
|
||||||
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
|
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
|
||||||
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
$labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
print $documentlink;
|
$labeltoshow .= $documentlink;
|
||||||
|
$labeltoshowalt .= $objectstatic->ref;
|
||||||
} elseif ($line->doc_type == 'bank') {
|
} elseif ($line->doc_type == 'bank') {
|
||||||
print $objectstatic->getNomUrl(1);
|
$labeltoshow .= $objectstatic->getNomUrl(1);
|
||||||
|
$labeltoshowalt .= $objectstatic->ref;
|
||||||
$bank_ref = strstr($line->doc_ref, '-');
|
$bank_ref = strstr($line->doc_ref, '-');
|
||||||
print " " . $bank_ref;
|
$labeltoshow .= " " . $bank_ref;
|
||||||
|
$labeltoshowalt .= " " . $bank_ref;
|
||||||
} else {
|
} else {
|
||||||
print $line->doc_ref;
|
$labeltoshow .= $line->doc_ref;
|
||||||
|
$labeltoshowalt .= $line->doc_ref;
|
||||||
}
|
}
|
||||||
print '</td></tr></table>';
|
|
||||||
|
|
||||||
|
print '<td class="nowraponall tdoverflowmax200" title="'.dol_escape_htmltag($labeltoshowalt).'">';
|
||||||
|
print $labeltoshow;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
@ -1167,7 +1177,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Label operation
|
// Label operation
|
||||||
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||||
print '<td>'.$line->label_operation.'</td>';
|
print '<td class="small tdoverflowmax200" title="'.dol_escape_htmltag($line->label_operation).'">'.dol_escape_htmltag($line->label_operation).'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1228,7 +1238,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Exported operation date
|
// Exported operation date
|
||||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||||
print '<td class="center">'.dol_print_date($line->date_export, 'dayhour').'</td>';
|
print '<td class="center nowraponall">'.dol_print_date($line->date_export, 'dayhour').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -1236,7 +1246,7 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Validated operation date
|
// Validated operation date
|
||||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
print '<td class="center nowraponall">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
$totalarray['nbfield']++;
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,6 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1719,8 +1719,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
||||||
|
|
||||||
@ -1737,9 +1735,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||||
}
|
}
|
||||||
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
}
|
}
|
||||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
||||||
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
||||||
@ -1778,7 +1776,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border tableforfield tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Tags / Categories
|
// Tags / Categories
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
@ -1853,18 +1851,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// VCard
|
|
||||||
/*
|
|
||||||
print '<tr><td>';
|
|
||||||
print $langs->trans("VCard").'</td><td colspan="3">';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
|
|
||||||
print img_picto($langs->trans("Download").' vcard', 'vcard.png', 'class="paddingrightonly"');
|
|
||||||
print $langs->trans("Download");
|
|
||||||
print img_picto($langs->trans("Download").' vcard', 'download', 'class="paddingleft"');
|
|
||||||
print '</a>';
|
|
||||||
print '</td></tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</div></div>\n";
|
print "</div></div>\n";
|
||||||
|
|||||||
@ -501,7 +501,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.dol_escape_htmltag($object->login).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
@ -512,25 +512,24 @@ if ($rowid > 0) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
||||||
|
|
||||||
// Civility
|
// Civility
|
||||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
|
print '<tr><td>'.$langs->trans("Password").'</td><td>';
|
||||||
if ($object->pass) {
|
if ($object->pass) {
|
||||||
print preg_replace('/./i', '*', $object->pass);
|
print preg_replace('/./i', '*', $object->pass);
|
||||||
} else {
|
} else {
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
|
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||||
} else {
|
|
||||||
print $langs->trans("Hidden");
|
|
||||||
}
|
}
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
}
|
}
|
||||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
||||||
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
||||||
@ -546,15 +545,17 @@ if ($rowid > 0) {
|
|||||||
print " ".img_warning($langs->trans("Late"));
|
print " ".img_warning($langs->trans("Late"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!$adht->subscription) {
|
if ($object->need_subscription == 0) {
|
||||||
|
print $langs->trans("SubscriptionNotNeeded");
|
||||||
|
} elseif (!$adht->subscription) {
|
||||||
print $langs->trans("SubscriptionNotRecorded");
|
print $langs->trans("SubscriptionNotRecorded");
|
||||||
if ($object->statut > 0) {
|
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($object->statut > 0) {
|
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,18 +564,13 @@ if ($rowid > 0) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
|
||||||
|
|
||||||
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Birthday
|
// Tags / Categories
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
|
||||||
|
|
||||||
// Public
|
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
@ -582,6 +578,12 @@ if ($rowid > 0) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Birth Date
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||||
|
|
||||||
|
// Public
|
||||||
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$cols = 2;
|
$cols = 2;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
@ -663,8 +665,6 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action bar
|
* Action bar
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedopjectblock.tpl.php -->\n";
|
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||||
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@ -201,7 +201,7 @@ $tabsql = array();
|
|||||||
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid";
|
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid";
|
||||||
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
|
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
|
||||||
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
|
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
|
||||||
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite FROM ".MAIN_DB_PREFIX."c_country AS c";
|
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX."c_country AS c";
|
||||||
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
|
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
|
||||||
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
|
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
|
||||||
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
|
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
|
||||||
@ -1093,6 +1093,45 @@ if ($action == 'disable_favorite') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Is in EEC - Activate
|
||||||
|
if ($action == 'activate_eec') {
|
||||||
|
if ($tabrowid[$id]) {
|
||||||
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($rowid) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
||||||
|
} elseif ($code) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if (!$result) {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is in EEC - Disable
|
||||||
|
if ($action == 'disable_eec') {
|
||||||
|
if ($tabrowid[$id]) {
|
||||||
|
$rowidcol = $tabrowid[$id];
|
||||||
|
} else {
|
||||||
|
$rowidcol = "rowid";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($rowid) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
||||||
|
} elseif ($code) {
|
||||||
|
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if (!$result) {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
@ -1452,6 +1491,7 @@ if ($id) {
|
|||||||
|
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
$tdsoffields .= '<td></td>';
|
$tdsoffields .= '<td></td>';
|
||||||
|
$tdsoffields .= '<td></td>';
|
||||||
}
|
}
|
||||||
$tdsoffields .= '<td>';
|
$tdsoffields .= '<td>';
|
||||||
$tdsoffields .= '<input type="hidden" name="id" value="'.$id.'">';
|
$tdsoffields .= '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
@ -1496,6 +1536,7 @@ if ($id) {
|
|||||||
|
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
print '<td colspan="3" class="center">';
|
print '<td colspan="3" class="center">';
|
||||||
if ($action != 'edit') {
|
if ($action != 'edit') {
|
||||||
@ -1569,6 +1610,7 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre right" colspan="2">';
|
print '<td class="liste_titre right" colspan="2">';
|
||||||
@ -1592,10 +1634,10 @@ if ($id) {
|
|||||||
|
|
||||||
// Determines the name of the field in relation to the possible names
|
// Determines the name of the field in relation to the possible names
|
||||||
// in data dictionaries
|
// in data dictionaries
|
||||||
$showfield = 1; // By defaut
|
$showfield = 1; // By default
|
||||||
$cssprefix = '';
|
$cssprefix = '';
|
||||||
$sortable = 1;
|
$sortable = 1;
|
||||||
$valuetoshow = ucfirst($value); // By defaut
|
$valuetoshow = ucfirst($value); // By default
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
|
|
||||||
// Special cases
|
// Special cases
|
||||||
@ -1794,8 +1836,9 @@ if ($id) {
|
|||||||
print getTitleFieldOfList($newvaluetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $value : ''), ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $cssprefix);
|
print getTitleFieldOfList($newvaluetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $value : ''), ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $cssprefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Favorite - Only activated on country dictionary
|
// Favorite & EEC - Only activated on country dictionary
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
|
print getTitleFieldOfList($langs->trans("InEEC"), 0, $_SERVER["PHP_SELF"], "eec", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder, '', 0, $langs->trans("CountryIsInEEC"));
|
||||||
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
|
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2089,10 +2132,19 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
$url .= '&';
|
$url .= '&';
|
||||||
|
|
||||||
// Favorite
|
// Favorite & EEC
|
||||||
// Only activated on country dictionary
|
// Only activated on country dictionary
|
||||||
if ($id == 4) {
|
if ($id == 4) {
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
|
// Is in EEC
|
||||||
|
if ($iserasable) {
|
||||||
|
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->eec].'_eec&token='.newToken().'">'.$actl[$obj->eec].'</a>';
|
||||||
|
} else {
|
||||||
|
print $langs->trans("AlwaysActive");
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="nowrap center">';
|
||||||
|
// Favorite
|
||||||
if ($iserasable) {
|
if ($iserasable) {
|
||||||
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite&token='.newToken().'">'.$actl[$obj->favorite].'</a>';
|
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite&token='.newToken().'">'.$actl[$obj->favorite].'</a>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $substitutionarrayfortest = array(
|
|||||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||||
'__LOGIN__' => 'RecipientLogin',
|
'__LOGIN__' => $user->login,
|
||||||
'__LASTNAME__' => 'RecipientLastname',
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
'__FIRSTNAME__' => 'RecipientFirstname',
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
'__ADDRESS__'=> 'RecipientAddress',
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
@ -662,7 +662,7 @@ if ($action == 'edit') {
|
|||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
||||||
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
|
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED);
|
print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED'));
|
||||||
} else {
|
} else {
|
||||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||||
}
|
}
|
||||||
@ -887,7 +887,6 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages($errormsg, null, 'errors');
|
setEventMessages($errormsg, null, 'errors');
|
||||||
print $errormsg;
|
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||||||
$langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors'));
|
$langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -40,17 +40,22 @@ if (!$user->admin) {
|
|||||||
$usersignature = $user->signature;
|
$usersignature = $user->signature;
|
||||||
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
|
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
|
||||||
if ($action == 'test' || $action == 'send') {
|
if ($action == 'test' || $action == 'send') {
|
||||||
$usersignature = dol_string_nohtmltag($usersignature);
|
$usersignature = dol_string_nohtmltag($usersignature, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarrayfortest = array(
|
$substitutionarrayfortest = array(
|
||||||
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
|
'__ID__' => 'RecipientIdRecord',
|
||||||
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
|
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||||
|
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||||
'__LOGIN__' => $user->login,
|
'__LOGIN__' => $user->login,
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__ZIP__'=> 'RecipientZip',
|
||||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''),
|
'__TOWN_'=> 'RecipientTown',
|
||||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
'__COUNTRY__'=> 'RecipientCountry'
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||||
|
|
||||||
@ -86,10 +91,10 @@ $trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
|||||||
$sendcontext = 'emailing'; // Force to use dedicated context of setup for emailing
|
$sendcontext = 'emailing'; // Force to use dedicated context of setup for emailing
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|
||||||
if ($action == 'presend' && GETPOST('trackid') == 'test') {
|
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'test') {
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
}
|
}
|
||||||
if ($action == 'presend' && GETPOST('trackid') == 'testhtml') {
|
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') {
|
||||||
$action = 'testhtml';
|
$action = 'testhtml';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,12 +276,15 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Host server
|
// Host server
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>';
|
print '<tr class="oddeven hideifdefault">';
|
||||||
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
||||||
|
print '<td>';
|
||||||
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $langs->trans("SeeLocalSendMailSetup");
|
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
print '<td>';
|
||||||
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
|
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
|
||||||
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
||||||
if ($linuxlike) {
|
if ($linuxlike) {
|
||||||
@ -287,17 +295,19 @@ if ($action == 'edit') {
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
// SuperAdministrator access only
|
// SuperAdministrator access only
|
||||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||||
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
|
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
|
||||||
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Port
|
// Port
|
||||||
|
|
||||||
@ -305,7 +315,7 @@ if ($action == 'edit') {
|
|||||||
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
||||||
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
|
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $langs->trans("SeeLocalSendMailSetup");
|
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
|
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
|
||||||
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
|
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
|
||||||
@ -319,7 +329,7 @@ if ($action == 'edit') {
|
|||||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
|
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
|
||||||
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = (!empty($mainport) ? $mainport : $smtpport);
|
$text = (!empty($mainport) ? $mainport : $smtpport);
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
@ -360,7 +370,6 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TLS
|
// TLS
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -374,7 +383,6 @@ if ($action == 'edit') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// STARTTLS
|
// STARTTLS
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -388,7 +396,6 @@ if ($action == 'edit') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// SMTP_ALLOW_SELF_SIGNED_EMAILING
|
// SMTP_ALLOW_SELF_SIGNED_EMAILING
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -414,6 +421,7 @@ if ($action == 'edit') {
|
|||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br><br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
@ -460,7 +468,7 @@ if ($action == 'edit') {
|
|||||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print yn(0).' ('.$langs->trans("NotSupported").')';
|
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -492,6 +500,7 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
@ -543,6 +552,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Run the test to connect
|
// Run the test to connect
|
||||||
if ($action == 'testconnect') {
|
if ($action == 'testconnect') {
|
||||||
|
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
|
||||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
@ -573,16 +583,18 @@ if ($action == 'edit') {
|
|||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$formmail->fromid = $user->id;
|
||||||
|
$formmail->fromalsorobot = 1;
|
||||||
$formmail->withfromreadonly = 0;
|
$formmail->withfromreadonly = 0;
|
||||||
$formmail->withsubstit = 0;
|
$formmail->withsubstit = 0;
|
||||||
$formmail->withfrom = 1;
|
$formmail->withfrom = 1;
|
||||||
$formmail->witherrorsto = 1;
|
$formmail->witherrorsto = 1;
|
||||||
$formmail->withto = (!GETPOST('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
$formmail->withto = (GETPOSTISSET('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
||||||
$formmail->withtocc = (!GETPOST(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
$formmail->withtocc = (GETPOSTISSET(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc = (!GETPOST(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
$formmail->withtoccc = (GETPOSTISSET(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly = 0;
|
$formmail->withtopicreadonly = 0;
|
||||||
$formmail->withfile = 2;
|
$formmail->withfile = 2;
|
||||||
@ -601,7 +613,7 @@ if ($action == 'edit') {
|
|||||||
$formmail->param["returnurl"] = $_SERVER["PHP_SELF"];
|
$formmail->param["returnurl"] = $_SERVER["PHP_SELF"];
|
||||||
|
|
||||||
// Init list of files
|
// Init list of files
|
||||||
if (GETPOST("mode") == 'init') {
|
if (GETPOST("mode", "aZ09") == 'init') {
|
||||||
$formmail->clear_attached_files();
|
$formmail->clear_attached_files();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -332,8 +332,8 @@ foreach ($TCurrency as &$currency) {
|
|||||||
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
||||||
print '1 '.$conf->currency.' = ';
|
print '1 '.$conf->currency.' = ';
|
||||||
print '<input type="text" name="rate" class="width75 right" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13"> '.$currency->code.' ';
|
print '<input type="text" name="rate" class="width75 right" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13"> '.$currency->code.' ';
|
||||||
print '<input type="submit" name="updatecurrency" class="button button-edit" value="'.$langs->trans("Modify").'"> ';
|
print '<input type="submit" name="updatecurrency" class="button button-edit smallpaddingimp" value="'.$langs->trans("Modify").'"> ';
|
||||||
print '<input type="submit" name="deletecurrency" class="button" value="'.$langs->trans("Delete").'">';
|
print '<input type="submit" name="deletecurrency" class="button smallpaddingimp" value="'.$langs->trans("Delete").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -406,7 +406,7 @@ print '<br><br>';
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
|
print load_fiche_titre($langs->trans("OtherSetup"), '', 'folder');
|
||||||
|
|
||||||
|
|
||||||
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
||||||
@ -439,19 +439,24 @@ print '<br>';
|
|||||||
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
|
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN).' <span class="opacitymedium">('.$langs->trans("Recommended").': 2)</span>'."<br>";
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
|
||||||
|
|
||||||
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
|
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN).' <span class="opacitymedium">('.$langs->trans("Recommended").': 2)</span>'."<br>";
|
|
||||||
print '<br>';
|
|
||||||
|
|
||||||
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
|
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
|
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
|
||||||
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
|
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
|
||||||
|
|||||||
@ -203,6 +203,12 @@ if ($action == 'setvarother') {
|
|||||||
if (!($res > 0)) {
|
if (!($res > 0)) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$param_auto_notify_close = GETPOST('TICKET_NOTIFY_AT_CLOSING', 'alpha');
|
||||||
|
$res = dolibarr_set_const($db, 'TICKET_NOTIFY_AT_CLOSING', $param_auto_notify_close, 'chaine', 0, '', $conf->entity);
|
||||||
|
if (!($res > 0)) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -530,6 +536,21 @@ print $form->textwithpicto('', $langs->trans("TicketsAutoAssignTicketHelp"), 1,
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Auto notify contacts when closing the ticket
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("TicketsAutoNotifyClose").'</td>';
|
||||||
|
print '<td class="left">';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('TICKET_NOTIFY_AT_CLOSING');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("TICKET_NOTIFY_AT_CLOSING", $arrval, $conf->global->TICKET_NOTIFY_AT_CLOSING);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="center">';
|
||||||
|
print $form->textwithpicto('', $langs->trans("TicketsAutoNotifyCloseHelp"), 1, 'help');
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
if (!$conf->use_javascript_ajax) {
|
if (!$conf->use_javascript_ajax) {
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -327,33 +327,6 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTextHelpMessageHelpAdmin"), 1, 'help');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Activate email creation to user
|
|
||||||
print '<tr class="pair"><td>'.$langs->trans("TicketsDisableCustomerEmail").'</td>';
|
|
||||||
print '<td class="left">';
|
|
||||||
if ($conf->use_javascript_ajax) {
|
|
||||||
print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
|
|
||||||
} else {
|
|
||||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
|
||||||
print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Texte de création d'un ticket
|
|
||||||
$mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
|
|
||||||
print '<tr><td>'.$langs->trans("TicketNewEmailBodyLabel").'</label>';
|
|
||||||
print '</td><td>';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
|
||||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
|
||||||
$doleditor->Create();
|
|
||||||
print '</td>';
|
|
||||||
print '<td class="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Url public interface
|
// Url public interface
|
||||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||||
print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
|
print '<tr><td>'.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'</label>';
|
||||||
@ -364,8 +337,45 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
print '<br><br>';
|
||||||
|
|
||||||
|
print_fiche_titre($langs->trans("Emails"));
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
|
// Activate email creation to user
|
||||||
|
print '<tr class="pair"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("TicketsDisableCustomerEmail"), $langs->trans("TicketsDisableEmailHelp"), 1, 'help');
|
||||||
|
print '</td>';
|
||||||
|
print '<td class="left">';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('TICKET_DISABLE_CUSTOMER_MAILS');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("TICKET_DISABLE_CUSTOMER_MAILS", $arrval, $conf->global->TICKET_DISABLE_CUSTOMER_MAILS);
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Text of email after creatio of a ticket
|
||||||
|
$mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
|
||||||
|
print '<tr><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
||||||
|
print '</label>';
|
||||||
|
print '</td><td>';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||||
|
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||||
|
$doleditor->Create();
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Activate email notification when a new message is added
|
// Activate email notification when a new message is added
|
||||||
print '<tr class="pair"><td>'.$langs->trans("TicketsPublicNotificationNewMessage").'</td>';
|
print '<tr class="pair"><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("TicketsPublicNotificationNewMessage"), $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
|
||||||
|
print '</td>';
|
||||||
print '<td class="left">';
|
print '<td class="left">';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
|
print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
|
||||||
@ -374,19 +384,15 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
|||||||
print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
|
print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">';
|
|
||||||
print $form->textwithpicto('', $langs->trans("TicketsPublicNotificationNewMessageHelp"), 1, 'help');
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Send notification when a new message is added to a email if a user is not assigned to the ticket
|
// Send notification when a new message is added to a email if a user is not assigned to the ticket
|
||||||
print '<tr><td>'.$langs->trans("TicketPublicNotificationNewMessageDefaultEmail").'</label>';
|
print '<tr><td>';
|
||||||
|
print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL.'" size="40" ></td>';
|
print '<input type="text" name="TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL" value="'.$conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_DEFAULT_EMAIL.'" size="40" ></td>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">';
|
print '</tr>';
|
||||||
print $form->textwithpicto('', $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|||||||
@ -137,7 +137,8 @@ $dirtocompress = basename($fulldirtocompress);
|
|||||||
|
|
||||||
if ($compression == 'zip') {
|
if ($compression == 'zip') {
|
||||||
$file .= '.zip';
|
$file .= '.zip';
|
||||||
$excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
|
|
||||||
|
$excludefiles = '/(\.back|\.old|\.log|\.pdf_preview-.*\.png|[\/\\\]temp[\/\\\]|[\/\\\]admin[\/\\\]documents[\/\\\])/i';
|
||||||
|
|
||||||
//var_dump($fulldirtocompress);
|
//var_dump($fulldirtocompress);
|
||||||
//var_dump($outputdir."/".$file);exit;
|
//var_dump($outputdir."/".$file);exit;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?DOLAPIKEY=**a
|
|||||||
Develop an API
|
Develop an API
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples http://help.luracast.com/restler/examples/
|
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples https://restler3.luracast.com/examples/index.html
|
||||||
|
|
||||||
Github contains also useful information : https://github.com/Luracast/Restler
|
Github contains also useful information : https://github.com/Luracast/Restler
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user, $db;
|
global $user, $db;
|
||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
|
|||||||
@ -160,7 +160,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '<table class="border centpercent tableforfieldcreate">';
|
print '<table class="border centpercent tableforfieldcreate">';
|
||||||
|
|
||||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth300" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("SetHereATitleForLink").'</span></td></tr>';
|
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth250" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("SetHereATitleForLink").'</span></td></tr>';
|
||||||
dol_set_focus('#titlebookmark');
|
dol_set_focus('#titlebookmark');
|
||||||
|
|
||||||
// Url
|
// Url
|
||||||
@ -230,9 +230,9 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
|||||||
|
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
print '<input class="flat minwidth300" name="title" value="'.(GETPOSTISSET("title") ? GETPOST("title", '', 2) : $object->title).'">';
|
print '<input class="flat minwidth250" name="title" value="'.(GETPOSTISSET("title") ? GETPOST("title", '', 2) : $object->title).'">';
|
||||||
} else {
|
} else {
|
||||||
print $object->title;
|
print dol_escape_htmltag($object->title);
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
|||||||
@ -186,35 +186,55 @@ class CActionComm
|
|||||||
|
|
||||||
$qualified = 1;
|
$qualified = 1;
|
||||||
|
|
||||||
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
|
// $obj->type can be 'system', 'systemauto', 'module', 'moduleauto', 'xxx', 'xxxauto'
|
||||||
|
// Note: type = system... than type of event is added among other standard events.
|
||||||
|
// type = module... then type of event is grouped into module defined into module = myobject@mymodule. Example: Event organization or external modules
|
||||||
|
// type = xxx... then type of event is added into list as a new flat value (not grouped). Example: Agefod external module
|
||||||
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
|
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
|
||||||
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
|
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($qualified && !empty($obj->module)) {
|
if ($qualified && !empty($obj->module)) {
|
||||||
if ($obj->module == 'invoice' && empty($conf->facture->enabled) && empty($user->facture->lire)) {
|
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
|
// Special cases
|
||||||
|
if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
||||||
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order' && empty($conf->commande->enabled) && empty($user->commande->lire)) {
|
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
|
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
|
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
|
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
|
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if (preg_match('/@eventorganization/', $obj->module) && empty($conf->eventorganization->enabled) && empty($user->eventorganization->read)) {
|
// For the generic case with type = 'module...' and module = 'myobject@mymodule'
|
||||||
$qualified = 0;
|
$regs = array();
|
||||||
|
if (preg_match('/^module/', $obj->type)) {
|
||||||
|
if (preg_match('/^(.+)@(.+)$/', $obj->module, $regs)) {
|
||||||
|
$tmpobject = $regs[1];
|
||||||
|
$tmpmodule = $regs[2];
|
||||||
|
//var_dump($user->$tmpmodule);
|
||||||
|
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled) && (!empty($user->rights->$tmpmodule->read) || !empty($user->rights->$tmpmodule->lire) || !empty($user->rights->$tmpmodule->$tmpobject->read) || !empty($user->rights->$tmpmodule->$tmpobject->lire))) {
|
||||||
|
$qualified = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// For the case type is not 'system...' neither 'module', we just check module is on
|
||||||
|
if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) {
|
||||||
|
$tmpmodule = $obj->module;
|
||||||
|
//var_dump($tmpmodule);
|
||||||
|
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled)) {
|
||||||
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if (!preg_match('/^system/', $obj->type) && isset($conf->{$obj->module}) && empty($conf->{$obj->module}->enabled)) {
|
|
||||||
$qualified = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,7 @@ if (empty($conf->global->AGENDA_EXT_NB)) {
|
|||||||
}
|
}
|
||||||
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
||||||
|
|
||||||
|
$check_holiday = GETPOST('check_holiday', 'int');
|
||||||
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
|
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
|
||||||
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
|
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
|
||||||
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
||||||
@ -579,10 +580,10 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
|||||||
$s .= '</script>'."\n";
|
$s .= '</script>'."\n";
|
||||||
|
|
||||||
// Local calendar
|
// Local calendar
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" value="1" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
||||||
|
|
||||||
// Holiday calendar
|
// Holiday calendar
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"'.($check_holiday ? ' checked' : '').'><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> </div>';
|
||||||
|
|
||||||
// External calendars
|
// External calendars
|
||||||
if (is_array($showextcals) && count($showextcals) > 0) {
|
if (is_array($showextcals) && count($showextcals) > 0) {
|
||||||
@ -607,13 +608,13 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
|||||||
foreach ($showextcals as $val) {
|
foreach ($showextcals as $val) {
|
||||||
$htmlname = md5($val['name']);
|
$htmlname = md5($val['name']);
|
||||||
|
|
||||||
if (!empty($val['default'])) {
|
if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) {
|
||||||
$default = "checked";
|
$default = "checked";
|
||||||
} else {
|
} else {
|
||||||
$default = '';
|
$default = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> </div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,6 +849,7 @@ if ($resql) {
|
|||||||
$event->fk_project = $obj->fk_project;
|
$event->fk_project = $obj->fk_project;
|
||||||
|
|
||||||
$event->socid = $obj->fk_soc;
|
$event->socid = $obj->fk_soc;
|
||||||
|
$event->thirdparty_id = $obj->fk_soc;
|
||||||
$event->contact_id = $obj->fk_contact;
|
$event->contact_id = $obj->fk_contact;
|
||||||
|
|
||||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||||
|
|||||||
@ -30,7 +30,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@ -1369,7 +1369,7 @@ if (empty($reshook)) {
|
|||||||
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
|
||||||
|
|
||||||
// Actions to build doc
|
// Actions to build doc
|
||||||
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
|
$upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output;
|
||||||
$permissiontoadd = $usercancreate;
|
$permissiontoadd = $usercancreate;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
|
|||||||
@ -3666,9 +3666,10 @@ class Commande extends CommonOrder
|
|||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @param int $addlinktonotes Add link to notes
|
* @param int $addlinktonotes Add link to notes
|
||||||
|
* @param string $target attribute target for link
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
|
public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0, $target = '')
|
||||||
{
|
{
|
||||||
global $conf, $langs, $user, $hookmanager;
|
global $conf, $langs, $user, $hookmanager;
|
||||||
|
|
||||||
@ -3737,6 +3738,11 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
$linkclose .= ' class="classfortooltip"';
|
$linkclose .= ' class="classfortooltip"';
|
||||||
|
|
||||||
|
$target_value=array('_self', '_blank', '_parent', '_top');
|
||||||
|
if (in_array($target, $target_value)) {
|
||||||
|
$linkclose .= ' target="'.dol_escape_htmltag($target).'"';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$linkstart = '<a href="'.$url.'"';
|
$linkstart = '<a href="'.$url.'"';
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
|
|||||||
@ -60,10 +60,11 @@ $newbankreceipt = GETPOST('newbankreceipt', 'alpha');
|
|||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldid = (!empty($ref) ? $ref : $id);
|
$fieldid = (!empty($ref) ? $ref : $id);
|
||||||
$fieldname = isset($ref) ? 'ref' : 'rowid';
|
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$socid = $user->socid;
|
$socid = $user->socid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = restrictedArea($user, 'banque', $fieldid, 'bank_account', '', '', $fieldname);
|
$result = restrictedArea($user, 'banque', $fieldid, 'bank_account', '', '', $fieldname);
|
||||||
|
|
||||||
if ($user->rights->banque->consolidate && $action == 'dvnext' && !empty($dvid)) {
|
if ($user->rights->banque->consolidate && $action == 'dvnext' && !empty($dvid)) {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblockForRec.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblockForRec.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -41,12 +41,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
$object = new RemiseCheque($db);
|
||||||
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
|
|
||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
@ -63,11 +58,22 @@ if (empty($page) || $page == -1) {
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|
||||||
$dir = $conf->bank->dir_output.'/checkdeposits/';
|
$upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits";
|
||||||
|
|
||||||
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
|
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
|
||||||
$filteraccountid = GETPOST('accountid', 'int');
|
$filteraccountid = GETPOST('accountid', 'int');
|
||||||
|
|
||||||
$object = new RemiseCheque($db);
|
// Security check
|
||||||
|
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
|
||||||
|
|
||||||
|
$usercanread = $user->rights->banque->cheque;
|
||||||
|
$usercancreate = $user->rights->banque->cheque;
|
||||||
|
$usercandelete = $user->rights->banque->cheque;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -241,7 +247,9 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
|
|||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
$file = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'cheque').GETPOST('file');
|
$filetodelete = GETPOST('file', 'alpha');
|
||||||
|
$file = $upload_dir.'/'.$filetodelete;
|
||||||
|
|
||||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||||
@ -634,6 +642,12 @@ if ($action == 'new') {
|
|||||||
$i = 1;
|
$i = 1;
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
while ($objp = $db->fetch_object($resql)) {
|
while ($objp = $db->fetch_object($resql)) {
|
||||||
|
$paymentstatic->id = $objp->pid;
|
||||||
|
$paymentstatic->ref = $objp->pref;
|
||||||
|
|
||||||
|
$accountlinestatic->id = $objp->rowid;
|
||||||
|
$accountlinestatic->ref = $objp->ref;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="center">'.$i.'</td>';
|
print '<td class="center">'.$i.'</td>';
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
|
||||||
@ -643,8 +657,6 @@ if ($action == 'new') {
|
|||||||
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
|
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
|
||||||
// Link to payment
|
// Link to payment
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$paymentstatic->id = $objp->pid;
|
|
||||||
$paymentstatic->ref = $objp->pref;
|
|
||||||
if ($paymentstatic->id) {
|
if ($paymentstatic->id) {
|
||||||
print $paymentstatic->getNomUrl(1);
|
print $paymentstatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
@ -653,8 +665,6 @@ if ($action == 'new') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// Link to bank transaction
|
// Link to bank transaction
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$accountlinestatic->id = $objp->rowid;
|
|
||||||
$accountlinestatic->ref = $objp->ref;
|
|
||||||
if ($accountlinestatic->id > 0) {
|
if ($accountlinestatic->id > 0) {
|
||||||
print $accountlinestatic->getNomUrl(1);
|
print $accountlinestatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
@ -664,10 +674,10 @@ if ($action == 'new') {
|
|||||||
// Action button
|
// Action button
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($object->statut == 0) {
|
if ($object->statut == 0) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&token='.newToken().'&lineid='.$objp->rowid.'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
if ($object->statut == 1 && $objp->statut != 2) {
|
if ($object->statut == 1 && $objp->statut != 2) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&token='.newToken().'&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
|
||||||
}
|
}
|
||||||
if ($objp->statut == 2) {
|
if ($objp->statut == 2) {
|
||||||
print ' '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
|
print ' '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
|
||||||
@ -723,11 +733,13 @@ print '</div>';
|
|||||||
|
|
||||||
if ($action != 'new') {
|
if ($action != 'new') {
|
||||||
if ($object->statut == 1) {
|
if ($object->statut == 1) {
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
// Documents
|
||||||
$filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'checkdeposits');
|
$objref = dol_sanitizeFileName($object->ref);
|
||||||
|
$filedir = $upload_dir.'/'.$objref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
$genallowed = $usercancreate;
|
||||||
print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
$delallowed = $usercandelete;
|
||||||
|
print $formfile->showdocuments('remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -615,6 +615,7 @@ class RemiseCheque extends CommonObject
|
|||||||
// We save charset_output to restore it because write_file can change it if needed for
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
// output format that does not support UTF8.
|
// output format that does not support UTF8.
|
||||||
$sav_charseSupprimert_output = $outputlangs->charset_output;
|
$sav_charseSupprimert_output = $outputlangs->charset_output;
|
||||||
|
|
||||||
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
|
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
//$outputlangs->charset_output=$sav_charset_output;
|
//$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($amounts[key($amounts)] <= 0) {
|
if (empty($amounts[key($amounts)])) {
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
|
||||||
$action = 'create';
|
$action = 'create';
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class ChargeSociales extends CommonObject
|
|||||||
{
|
{
|
||||||
$sql = "SELECT cs.rowid, cs.date_ech";
|
$sql = "SELECT cs.rowid, cs.date_ech";
|
||||||
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
|
$sql .= ", cs.libelle as label, cs.fk_type, cs.amount, cs.fk_projet as fk_project, cs.paye, cs.periode, cs.import_key";
|
||||||
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user";
|
$sql .= ", cs.fk_account, cs.fk_mode_reglement, cs.fk_user, note_public, note_private";
|
||||||
$sql .= ", c.libelle as type_label";
|
$sql .= ", c.libelle as type_label";
|
||||||
$sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
$sql .= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
@ -172,6 +172,8 @@ class ChargeSociales extends CommonObject
|
|||||||
$this->amount = $obj->amount;
|
$this->amount = $obj->amount;
|
||||||
$this->fk_project = $obj->fk_project;
|
$this->fk_project = $obj->fk_project;
|
||||||
$this->fk_user = $obj->fk_user;
|
$this->fk_user = $obj->fk_user;
|
||||||
|
$this->note_public = $obj->note_public;
|
||||||
|
$this->note_private = $obj->note_private;
|
||||||
$this->paye = $obj->paye;
|
$this->paye = $obj->paye;
|
||||||
$this->periode = $this->db->jdate($obj->periode);
|
$this->periode = $this->db->jdate($obj->periode);
|
||||||
$this->import_key = $this->import_key;
|
$this->import_key = $this->import_key;
|
||||||
|
|||||||
@ -81,7 +81,7 @@ $object->info($id);
|
|||||||
|
|
||||||
$head = tax_prepare_head($object);
|
$head = tax_prepare_head($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, 'bill');
|
print dol_get_fiche_head($head, 'info', $langs->trans("SocialContribution"), -1, $object->picto);
|
||||||
|
|
||||||
$morehtmlref = '<div class="refidno">';
|
$morehtmlref = '<div class="refidno">';
|
||||||
// Label of social contribution
|
// Label of social contribution
|
||||||
@ -115,7 +115,7 @@ print '<div class="underbanner clearboth"></div>';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table class="centpercent"><tr><td>';
|
||||||
dol_print_object_info($object);
|
dol_print_object_info($object);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
135
htdocs/compta/sociales/note.php
Normal file
135
htdocs/compta/sociales/note.php
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2007-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/compta/sociales/note.php
|
||||||
|
* \ingroup tax
|
||||||
|
* \brief Tab for notes on Taxes
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
if (!empty($conf->projet->enabled)) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array('compta', 'bills'));
|
||||||
|
|
||||||
|
// Get parameters
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
|
$object = new ChargeSociales($db);
|
||||||
|
if ($id > 0) {
|
||||||
|
$object->fetch($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$socid = GETPOST('socid', 'int');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'tax', $object->id, 'chargesociales', 'charges');
|
||||||
|
|
||||||
|
$permissiontoread = $user->rights->tax->charges->lire;
|
||||||
|
$permissiontoadd = $user->rights->tax->charges->creer;
|
||||||
|
$permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
if (empty($reshook)) {
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans("SocialContribution").' - '.$langs->trans("Note");
|
||||||
|
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)';
|
||||||
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref)) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
$head = tax_prepare_head($object);
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'note', $langs->trans("SocialContribution"), -1, $object->picto);
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
// Label of social contribution
|
||||||
|
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
||||||
|
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||||
|
// Project
|
||||||
|
if (!empty($conf->projet->enabled)) {
|
||||||
|
$langs->load("projects");
|
||||||
|
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
|
||||||
|
if (!empty($object->fk_project)) {
|
||||||
|
$proj = new Project($db);
|
||||||
|
$proj->fetch($object->fk_project);
|
||||||
|
$morehtmlref .= ' : '.$proj->getNomUrl(1);
|
||||||
|
if ($proj->title) {
|
||||||
|
$morehtmlref .= ' - '.dol_escape_htmltag($proj->title);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
// Object card
|
||||||
|
// ------------------------------------------------------------
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
//$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||||
|
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
|
||||||
|
$cssclass = "titlefield";
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -1580,16 +1580,19 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
foreach ($toselect as $toselectid) {
|
foreach ($toselect as $toselectid) {
|
||||||
$result = $objecttmp->fetch($toselectid);
|
$result = $objecttmp->fetch($toselectid);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
if ($objecttmp->statut == Holiday::STATUS_VALIDATED && $user->id == $objecttmp->fk_validator) {
|
if ($objecttmp->statut != Holiday::STATUS_VALIDATED) {
|
||||||
|
setEventMessages($langs->trans('StatusOfRefMustBe', $objecttmp->ref, $langs->transnoentitiesnoconv('Validated')), null, 'warnings');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($user->id == $objecttmp->fk_validator) {
|
||||||
$objecttmp->oldcopy = dol_clone($objecttmp);
|
$objecttmp->oldcopy = dol_clone($objecttmp);
|
||||||
|
|
||||||
$objecttmp->date_valid = dol_now();
|
$objecttmp->date_valid = dol_now();
|
||||||
$objecttmp->fk_user_valid = $user->id;
|
$objecttmp->fk_user_valid = $user->id;
|
||||||
$objecttmp->statut = Holiday::STATUS_APPROVED;
|
$objecttmp->statut = Holiday::STATUS_APPROVED;
|
||||||
|
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
$verif = $objecttmp->approve($user);
|
$verif = $objecttmp->approve($user);
|
||||||
|
|
||||||
if ($verif <= 0) {
|
if ($verif <= 0) {
|
||||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -1664,14 +1667,9 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$db->commit();
|
|
||||||
$nbok++;
|
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$langs->load("errors");
|
||||||
$action = '';
|
setEventMessages($langs->trans('ErrorNotApproverForHoliday', $objecttmp->ref), null, 'errors');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
@ -1683,7 +1681,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
if ($nbok > 1) {
|
if ($nbok > 1) {
|
||||||
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
|
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
|
||||||
} else {
|
} elseif ($nbok == 1) {
|
||||||
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|||||||
@ -81,8 +81,6 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
|
} elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
|
|
||||||
$perm = 1;
|
|
||||||
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
|
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'bom_bomline' && $user->rights->bom->write) {
|
} elseif ($table_element_line == 'bom_bomline' && $user->rights->bom->write) {
|
||||||
@ -97,10 +95,18 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
|
|||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'facture_fourn_det_rec' && $user->rights->fournisseur->facture->creer) {
|
} elseif ($table_element_line == 'facture_fourn_det_rec' && $user->rights->fournisseur->facture->creer) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
|
} elseif ($table_element_line == 'ecm_files') { // Used when of page "documents.php"
|
||||||
|
if (!empty($user->rights->ecm->creer)) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'ecm_files' && $fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
|
} elseif ($fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
|
} elseif ($fk_element == 'fk_ticket' && !empty($user->rights->ticket->write)) {
|
||||||
|
$perm = 1;
|
||||||
|
} elseif ($fk_element == 'fk_holiday' && !empty($user->rights->holiday->write)) {
|
||||||
|
$perm = 1;
|
||||||
|
} elseif ($fk_element == 'fk_soc' && !empty($user->rights->societe->creer)) {
|
||||||
|
$perm = 1;
|
||||||
|
}
|
||||||
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
|
} elseif ($table_element_line == 'product_association' && $fk_element == 'fk_product' && (!empty($user->rights->produit->creer) || !empty($user->rights->service->creer))) {
|
||||||
$perm = 1;
|
$perm = 1;
|
||||||
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
|
} elseif ($table_element_line == 'projet_task' && $fk_element == 'fk_projet' && $user->rights->projet->creer) {
|
||||||
|
|||||||
@ -165,7 +165,7 @@ class Conf
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load setup values into conf object (read llx_const) for a specified entity
|
* Load setup values into conf object (read llx_const) for a specified entity
|
||||||
* Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setValues is called.
|
* Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setEntityValues is called.
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
* @param int $entity Entity to get
|
* @param int $entity Entity to get
|
||||||
|
|||||||
@ -326,19 +326,19 @@ class DolEditor
|
|||||||
|
|
||||||
$out .= 'jQuery(document).ready(function() {
|
$out .= 'jQuery(document).ready(function() {
|
||||||
jQuery(".buttonforacesave").click(function() {
|
jQuery(".buttonforacesave").click(function() {
|
||||||
console.log("We click on savefile button for component '.$this->htmlname.'");
|
console.log("We click on savefile button for component '.dol_escape_js($this->htmlname).'");
|
||||||
var aceEditor = window.ace.edit("'.$this->htmlname.'aceeditorid");
|
var aceEditor = window.ace.edit("'.dol_escape_js($this->htmlname).'aceeditorid");
|
||||||
if (aceEditor) {
|
if (aceEditor) {
|
||||||
var cursorPos = aceEditor.getCursorPosition();
|
var cursorPos = aceEditor.getCursorPosition();
|
||||||
//console.log(cursorPos);
|
//console.log(cursorPos);
|
||||||
if (cursorPos) {
|
if (cursorPos) {
|
||||||
jQuery("#'.$this->htmlname.'_x").val(cursorPos.column);
|
jQuery("#'.dol_escape_js($this->htmlname).'_x").val(cursorPos.column);
|
||||||
jQuery("#'.$this->htmlname.'_y").val(cursorPos.row);
|
jQuery("#'.dol_escape_js($this->htmlname).'_y").val(cursorPos.row);
|
||||||
}
|
}
|
||||||
//console.log(aceEditor.getSession().getValue());
|
//console.log(aceEditor.getSession().getValue());
|
||||||
// Inject content of editor into the original HTML field.
|
// Inject content of editor into the original HTML field.
|
||||||
jQuery("#'.$this->htmlname.'").val(aceEditor.getSession().getValue());
|
jQuery("#'.dol_escape_js($this->htmlname).'").val(aceEditor.getSession().getValue());
|
||||||
/*if (jQuery("#'.$this->htmlname.'").html().length > 0) return true;
|
/*if (jQuery("#'.dol_escape_js($this->htmlname).'").html().length > 0) return true;
|
||||||
else return false;*/
|
else return false;*/
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -642,14 +642,14 @@ class dolReceiptPrinter extends Printer
|
|||||||
case 'DOL_PRINT_OBJECT_LINES':
|
case 'DOL_PRINT_OBJECT_LINES':
|
||||||
foreach ($object->lines as $line) {
|
foreach ($object->lines as $line) {
|
||||||
if ($line->fk_product) {
|
if ($line->fk_product) {
|
||||||
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
|
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
|
||||||
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
||||||
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
$this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n");
|
||||||
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n");
|
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n");
|
||||||
} else {
|
} else {
|
||||||
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - 10 - 1;
|
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
|
||||||
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
||||||
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -791,7 +791,7 @@ class Form
|
|||||||
|
|
||||||
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
|
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
|
||||||
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
|
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
|
||||||
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button small'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button smallpaddingimp'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
|
||||||
$ret .= '</div>';
|
$ret .= '</div>';
|
||||||
|
|
||||||
if (!empty($conf->use_javascript_ajax)) {
|
if (!empty($conf->use_javascript_ajax)) {
|
||||||
@ -4901,7 +4901,7 @@ class Form
|
|||||||
$more .= '<div class="tagtr">';
|
$more .= '<div class="tagtr">';
|
||||||
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
|
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
|
||||||
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
|
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
|
||||||
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') {
|
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
|
||||||
$more .= ' checked';
|
$more .= ' checked';
|
||||||
}
|
}
|
||||||
if (is_bool($input['value']) && $input['value']) {
|
if (is_bool($input['value']) && $input['value']) {
|
||||||
@ -4957,6 +4957,8 @@ class Form
|
|||||||
$moreonecolumn .= '</div>'."\n";
|
$moreonecolumn .= '</div>'."\n";
|
||||||
} elseif ($input['type'] == 'hidden') {
|
} elseif ($input['type'] == 'hidden') {
|
||||||
// Do nothing more, already added by a previous loop
|
// Do nothing more, already added by a previous loop
|
||||||
|
} elseif ($input['type'] == 'separator') {
|
||||||
|
$more .= '<br>';
|
||||||
} else {
|
} else {
|
||||||
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
|
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
|
||||||
}
|
}
|
||||||
@ -5129,7 +5131,7 @@ class Form
|
|||||||
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
||||||
$formconfirm .= '<td class="valid center">';
|
$formconfirm .= '<td class="valid center">';
|
||||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
||||||
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'">';
|
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
|
||||||
$formconfirm .= '</td>';
|
$formconfirm .= '</td>';
|
||||||
$formconfirm .= '</tr>'."\n";
|
$formconfirm .= '</tr>'."\n";
|
||||||
|
|
||||||
@ -5200,6 +5202,7 @@ class Form
|
|||||||
$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
$out .= '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||||
$out .= '</form>';
|
$out .= '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
$out .= '<span class="project_head_block">';
|
||||||
if ($selected) {
|
if ($selected) {
|
||||||
$projet = new Project($this->db);
|
$projet = new Project($this->db);
|
||||||
$projet->fetch($selected);
|
$projet->fetch($selected);
|
||||||
@ -5207,6 +5210,7 @@ class Form
|
|||||||
} else {
|
} else {
|
||||||
$out .= " ";
|
$out .= " ";
|
||||||
}
|
}
|
||||||
|
$out .= '</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($nooutput)) {
|
if (empty($nooutput)) {
|
||||||
@ -6676,7 +6680,7 @@ class Form
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$retstring = '';
|
$retstring = '<span class="nowraponall">';
|
||||||
|
|
||||||
$hourSelected = 0;
|
$hourSelected = 0;
|
||||||
$minSelected = 0;
|
$minSelected = 0;
|
||||||
@ -6708,7 +6712,7 @@ class Form
|
|||||||
if ($typehour != 'text') {
|
if ($typehour != 'text') {
|
||||||
$retstring .= ' '.$langs->trans('HourShort');
|
$retstring .= ' '.$langs->trans('HourShort');
|
||||||
} else {
|
} else {
|
||||||
$retstring .= '<span class="hideonsmartphone">:</span>';
|
$retstring .= '<span class="">:</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minutes
|
// Minutes
|
||||||
@ -6736,7 +6740,7 @@ class Form
|
|||||||
$retstring .= ' '.$langs->trans('MinuteShort');
|
$retstring .= ' '.$langs->trans('MinuteShort');
|
||||||
}
|
}
|
||||||
|
|
||||||
//$retstring.=" ";
|
$retstring.="</span>";
|
||||||
|
|
||||||
if (!empty($nooutput)) {
|
if (!empty($nooutput)) {
|
||||||
return $retstring;
|
return $retstring;
|
||||||
|
|||||||
@ -360,8 +360,8 @@ class FormFile
|
|||||||
* This also set the property $this->numoffiles
|
* This also set the property $this->numoffiles
|
||||||
*
|
*
|
||||||
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
|
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
|
||||||
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into a subdir of module.
|
||||||
* @param string $filedir Directory to scan
|
* @param string $filedir Directory to scan (must not end with a /). Example: '/mydolibarrdocuments/facture/FAYYMM-1234'
|
||||||
* @param string $urlsource Url of origin page (for return)
|
* @param string $urlsource Url of origin page (for return)
|
||||||
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
|
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
|
||||||
* @param int $delallowed Remove is allowed (1/0)
|
* @param int $delallowed Remove is allowed (1/0)
|
||||||
@ -1283,12 +1283,22 @@ class FormFile
|
|||||||
}
|
}
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
if (!$disablemove) {
|
if (empty($disablemove) && count($filearray) > 1) {
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get list of files stored into database for same relative directory
|
||||||
|
if ($relativedir) {
|
||||||
|
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
|
||||||
|
|
||||||
|
//var_dump($sortfield.' - '.$sortorder);
|
||||||
|
if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
|
||||||
|
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="liste_titre nodrag nodrop">';
|
print '<tr class="liste_titre nodrag nodrop">';
|
||||||
//print $url.' sortfield='.$sortfield.' sortorder='.$sortorder;
|
//print $url.' sortfield='.$sortfield.' sortorder='.$sortorder;
|
||||||
print_liste_field_titre('Documents2', $url, "name", "", $param, '', $sortfield, $sortorder, 'left ');
|
print_liste_field_titre('Documents2', $url, "name", "", $param, '', $sortfield, $sortorder, 'left ');
|
||||||
@ -1301,21 +1311,11 @@ class FormFile
|
|||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
// Action button
|
// Action button
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
if (!$disablemove) {
|
if (empty($disablemove) && count($filearray) > 1) {
|
||||||
print_liste_field_titre('');
|
print_liste_field_titre('');
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Get list of files stored into database for same relative directory
|
|
||||||
if ($relativedir) {
|
|
||||||
completeFileArrayWithDatabaseInfo($filearray, $relativedir);
|
|
||||||
|
|
||||||
//var_dump($sortfield.' - '.$sortorder);
|
|
||||||
if ($sortfield && $sortorder) { // If $sortfield is for example 'position_name', we will sort on the property 'position_name' (that is concat of position+name)
|
|
||||||
$filearray = dol_sort_array($filearray, $sortfield, $sortorder);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$nboffiles = count($filearray);
|
$nboffiles = count($filearray);
|
||||||
if ($nboffiles > 0) {
|
if ($nboffiles > 0) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
@ -1510,18 +1510,18 @@ class FormFile
|
|||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
if (empty($disablemove)) {
|
if (empty($disablemove) && count($filearray) > 1) {
|
||||||
if ($nboffiles > 1 && $conf->browser->layout != 'phone') {
|
if ($nboffiles > 1 && $conf->browser->layout != 'phone') {
|
||||||
print '<td class="linecolmove tdlineupdown center">';
|
print '<td class="linecolmove tdlineupdown center">';
|
||||||
if ($i > 0) {
|
if ($i > 0) {
|
||||||
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default', 0, 'imgupforline').'</a>';
|
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=up&rowid='.$line->id.'">'.img_up('default', 0, 'imgupforline').'</a>';
|
||||||
}
|
}
|
||||||
if ($i < $nboffiles - 1) {
|
if ($i < ($nboffiles - 1)) {
|
||||||
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">'.img_down('default', 0, 'imgdownforline').'</a>';
|
print '<a class="lineupdown" href="'.$_SERVER["PHP_SELF"].'?id='.$this->id.'&action=down&rowid='.$line->id.'">'.img_down('default', 0, 'imgdownforline').'</a>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td'.(($conf->browser->layout != 'phone' && empty($disablemove)) ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>';
|
print '<td'.(($conf->browser->layout != 'phone') ? ' class="linecolmove tdlineupdown center"' : ' class="linecolmove center"').'>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1531,7 +1531,7 @@ class FormFile
|
|||||||
print '<input type="submit" class="button button-save" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
print '<input type="submit" class="button button-save" name="renamefilesave" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (empty($disablemove)) {
|
if (empty($disablemove) && count($filearray) > 1) {
|
||||||
print '<td class="right"></td>';
|
print '<td class="right"></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1542,7 +1542,7 @@ class FormFile
|
|||||||
}
|
}
|
||||||
if ($nboffiles == 0) {
|
if ($nboffiles == 0) {
|
||||||
$colspan = '6';
|
$colspan = '6';
|
||||||
if (empty($disablemove)) {
|
if (empty($disablemove) && count($filearray) > 1) {
|
||||||
$colspan++; // 6 columns or 7
|
$colspan++; // 6 columns or 7
|
||||||
}
|
}
|
||||||
print '<tr class="oddeven"><td colspan="'.$colspan.'">';
|
print '<tr class="oddeven"><td colspan="'.$colspan.'">';
|
||||||
@ -2032,7 +2032,7 @@ class FormFile
|
|||||||
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
|
print '<form action="'.$_SERVER['PHP_SELF'].($param ? '?'.$param : '').'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<table width="100%" class="liste noborder nobottom">';
|
print '<table class="liste noborder nobottom centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre(
|
print_liste_field_titre(
|
||||||
$langs->trans("Links"),
|
$langs->trans("Links"),
|
||||||
@ -2117,7 +2117,7 @@ class FormFile
|
|||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'&token='.newToken().'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=update&linkid='.$link->id.$param.'&token='.newToken().'" class="editfilelink editfielda reposition" >'.img_edit().'</a>'; // id= is included into $param
|
||||||
if ($permissiontodelete) {
|
if ($permissiontodelete) {
|
||||||
print ' <a class="deletefilelink" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&linkid='.$link->id.$param.'">'.img_delete().'</a>'; // id= is included into $param
|
print ' <a class="deletefilelink reposition" href="'.$_SERVER['PHP_SELF'].'?action=deletelink&token='.newToken().'&linkid='.((int) $link->id).$param.'">'.img_delete().'</a>'; // id= is included into $param
|
||||||
} else {
|
} else {
|
||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1250,7 +1250,7 @@ class FormMail extends Form
|
|||||||
* Return templates of email with type = $type_template or type = 'all'.
|
* Return templates of email with type = $type_template or type = 'all'.
|
||||||
* This search into table c_email_templates. Used by the get_form function.
|
* This search into table c_email_templates. Used by the get_form function.
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $dbs Database handler
|
||||||
* @param string $type_template Get message for model/type=$type_template, type='all' also included.
|
* @param string $type_template Get message for model/type=$type_template, type='all' also included.
|
||||||
* @param User $user Get template public or limited to this user
|
* @param User $user Get template public or limited to this user
|
||||||
* @param Translate $outputlangs Output lang object
|
* @param Translate $outputlangs Output lang object
|
||||||
@ -1259,7 +1259,7 @@ class FormMail extends Form
|
|||||||
* @param string $label Label of template
|
* @param string $label Label of template
|
||||||
* @return ModelMail|integer One instance of ModelMail or -1 if error
|
* @return ModelMail|integer One instance of ModelMail or -1 if error
|
||||||
*/
|
*/
|
||||||
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
public function getEMailTemplate($dbs, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
@ -1279,18 +1279,18 @@ class FormMail extends Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT rowid, module, label, type_template, topic, joinfiles, content, content_lines, lang";
|
$sql = "SELECT rowid, module, label, type_template, topic, joinfiles, content, content_lines, lang";
|
||||||
$sql .= " FROM ".$db->prefix().'c_email_templates';
|
$sql .= " FROM ".$dbs->prefix().'c_email_templates';
|
||||||
$sql .= " WHERE (type_template='".$db->escape($type_template)."' OR type_template='all')";
|
$sql .= " WHERE (type_template='".$dbs->escape($type_template)."' OR type_template='all')";
|
||||||
$sql .= " AND entity IN (".getEntity('c_email_templates').")";
|
$sql .= " AND entity IN (".getEntity('c_email_templates').")";
|
||||||
$sql .= " AND (private = 0 OR fk_user = ".((int) $user->id).")"; // Get all public or private owned
|
$sql .= " AND (private = 0 OR fk_user = ".((int) $user->id).")"; // Get all public or private owned
|
||||||
if ($active >= 0) {
|
if ($active >= 0) {
|
||||||
$sql .= " AND active = ".((int) $active);
|
$sql .= " AND active = ".((int) $active);
|
||||||
}
|
}
|
||||||
if ($label) {
|
if ($label) {
|
||||||
$sql .= " AND label = '".$db->escape($label)."'";
|
$sql .= " AND label = '".$dbs->escape($label)."'";
|
||||||
}
|
}
|
||||||
if (!($id > 0) && $languagetosearch) {
|
if (!($id > 0) && $languagetosearch) {
|
||||||
$sql .= " AND (lang = '".$db->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$db->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
|
$sql .= " AND (lang = '".$dbs->escape($languagetosearch)."'".($languagetosearchmain ? " OR lang = '".$dbs->escape($languagetosearchmain)."'" : "")." OR lang IS NULL OR lang = '')";
|
||||||
}
|
}
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$sql .= " AND rowid=".(int) $id;
|
$sql .= " AND rowid=".(int) $id;
|
||||||
@ -1299,22 +1299,22 @@ class FormMail extends Form
|
|||||||
$sql .= " AND position=0";
|
$sql .= " AND position=0";
|
||||||
}
|
}
|
||||||
if ($languagetosearch) {
|
if ($languagetosearch) {
|
||||||
$sql .= $db->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
|
$sql .= $dbs->order("position,lang,label", "ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
|
||||||
} else {
|
} else {
|
||||||
$sql .= $db->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
|
$sql .= $dbs->order("position,lang,label", "ASC,ASC,ASC"); // If no language provided, we give priority to lang not defined
|
||||||
}
|
}
|
||||||
//$sql .= $db->plimit(1);
|
//$sql .= $dbs->plimit(1);
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $dbs->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
dol_print_error($db);
|
dol_print_error($dbs);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get first found
|
// Get first found
|
||||||
while (1) {
|
while (1) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $dbs->fetch_object($resql);
|
||||||
|
|
||||||
if ($obj) {
|
if ($obj) {
|
||||||
// If template is for a module, check module is enabled; if not, take next template
|
// If template is for a module, check module is enabled; if not, take next template
|
||||||
@ -1386,7 +1386,8 @@ class FormMail extends Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$dbs->free($resql);
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -847,8 +848,13 @@ class Utils
|
|||||||
$resarray = $utils->executeCLI($command, $outfile);
|
$resarray = $utils->executeCLI($command, $outfile);
|
||||||
if ($resarray['result'] != '0') {
|
if ($resarray['result'] != '0') {
|
||||||
$this->error = $resarray['error'].' '.$resarray['output'];
|
$this->error = $resarray['error'].' '.$resarray['output'];
|
||||||
|
$this->errors[] = $this->error;
|
||||||
}
|
}
|
||||||
$result = ($resarray['result'] == 0) ? 1 : 0;
|
$result = ($resarray['result'] == 0) ? 1 : 0;
|
||||||
|
if ($result < 0 && empty($this->errors)) {
|
||||||
|
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOC);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
}
|
||||||
|
|
||||||
// Build PDF doc
|
// Build PDF doc
|
||||||
$command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF;
|
$command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF;
|
||||||
@ -856,8 +862,13 @@ class Utils
|
|||||||
$resarray = $utils->executeCLI($command, $outfile);
|
$resarray = $utils->executeCLI($command, $outfile);
|
||||||
if ($resarray['result'] != '0') {
|
if ($resarray['result'] != '0') {
|
||||||
$this->error = $resarray['error'].' '.$resarray['output'];
|
$this->error = $resarray['error'].' '.$resarray['output'];
|
||||||
|
$this->errors[] = $this->error;
|
||||||
}
|
}
|
||||||
$result = ($resarray['result'] == 0) ? 1 : 0;
|
$result = ($resarray['result'] == 0) ? 1 : 0;
|
||||||
|
if ($result < 0 && empty($this->errors)) {
|
||||||
|
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOCPDF);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
}
|
||||||
|
|
||||||
chdir($currentdir);
|
chdir($currentdir);
|
||||||
} else {
|
} else {
|
||||||
@ -868,8 +879,6 @@ class Utils
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
|
||||||
$this->error = $langs->trans("ErrorFailToGenerateFile", $outputfiledoc);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
@ -1176,4 +1185,112 @@ class Utils
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make a send last backup of database or fil in param
|
||||||
|
* CAN BE A CRON TASK
|
||||||
|
*
|
||||||
|
* @param string $sendto Recipients emails
|
||||||
|
* @param string $from Sender email
|
||||||
|
* @param string $subject Topic/Subject of mail
|
||||||
|
* @param string $message Message
|
||||||
|
* @param string $filename List of files to attach (full path of filename on file system)
|
||||||
|
* @param string $filter Filter file send
|
||||||
|
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||||
|
*/
|
||||||
|
public function sendBackup($sendto = '', $from = '', $subject = '', $message = '', $filename = '', $filter = '')
|
||||||
|
{
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$filepath = '';
|
||||||
|
$output = '';
|
||||||
|
$error = 0;
|
||||||
|
|
||||||
|
if (!empty($from)) {
|
||||||
|
$from = dol_escape_htmltag($from);
|
||||||
|
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
|
||||||
|
$from = dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($sendto)) {
|
||||||
|
$sendto = dol_escape_htmltag($sendto);
|
||||||
|
} elseif (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) {
|
||||||
|
$from = dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL);
|
||||||
|
} else {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($subject)) {
|
||||||
|
$subject = dol_escape_htmltag($subject);
|
||||||
|
} else {
|
||||||
|
$subject = dol_escape_htmltag($langs->trans('MakeSendLocalDatabaseDumpShort'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($message)) {
|
||||||
|
$message = dol_escape_htmltag($langs->trans('MakeSendLocalDatabaseDumpShort'));
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
if ($filename) {
|
||||||
|
if (dol_is_file($conf->admin->dir_output.'/backup/'.$filename)) {
|
||||||
|
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filename);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$tmpfiles = dol_most_recent_file($conf->admin->dir_output.'/backup', $filter);
|
||||||
|
}
|
||||||
|
if ($tmpfiles) {
|
||||||
|
foreach ($tmpfiles as $key => $val) {
|
||||||
|
if ($key == 'fullname') {
|
||||||
|
$filepath = array($val);
|
||||||
|
$filesize = dol_filesize($val);
|
||||||
|
}
|
||||||
|
if ($key == 'type') {
|
||||||
|
$mimetype = array($val);
|
||||||
|
}
|
||||||
|
if ($key == 'relativename') {
|
||||||
|
$filename = array($val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($filepath) {
|
||||||
|
if ($filesize > 100000000) {
|
||||||
|
$output = 'Sorry, last backup file is too large to be send by email';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$output = 'No backup file found';
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||||
|
$mailfile = new CMailFile($subject, $sendto, $from, $message, $filepath, $mimetype, $filename, '', '', 0, -1);
|
||||||
|
if ($mailfile->error) {
|
||||||
|
$error++;
|
||||||
|
$output = $mailfile->error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$error) {
|
||||||
|
$result = $mailfile->sendfile();
|
||||||
|
if ($result <= 0) {
|
||||||
|
$error++;
|
||||||
|
$output = $mailfile->error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
|
|
||||||
|
$this->error = $error;
|
||||||
|
$this->output = $output;
|
||||||
|
|
||||||
|
if ($result == true) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,6 +65,7 @@ function SetCurrentFolder( resourceType, folderPath )
|
|||||||
|
|
||||||
function OnSubmit()
|
function OnSubmit()
|
||||||
{
|
{
|
||||||
|
console.log("Click on OnSubmit");
|
||||||
if ( document.getElementById('NewFile').value.length == 0 )
|
if ( document.getElementById('NewFile').value.length == 0 )
|
||||||
{
|
{
|
||||||
alert( 'Please select a file from your computer' );
|
alert( 'Please select a file from your computer' );
|
||||||
@ -80,6 +81,8 @@ function OnSubmit()
|
|||||||
|
|
||||||
function OnUploadCompleted( errorNumber, data )
|
function OnUploadCompleted( errorNumber, data )
|
||||||
{
|
{
|
||||||
|
console.log("errorNumber = "+errorNumber);
|
||||||
|
|
||||||
// Reset the Upload Worker Frame.
|
// Reset the Upload Worker Frame.
|
||||||
window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
|
window.parent.frames['frmUploadWorker'].location = 'javascript:void(0)' ;
|
||||||
|
|
||||||
@ -106,7 +109,7 @@ function OnUploadCompleted( errorNumber, data )
|
|||||||
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' );
|
alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + data + '"' );
|
||||||
break;
|
break;
|
||||||
case 202:
|
case 202:
|
||||||
alert( 'Invalid file' );
|
alert( 'Invalid file (Bad extension)' );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
alert( 'Error on file upload. Error number: ' + errorNumber );
|
alert( 'Error on file upload. Error number: ' + errorNumber );
|
||||||
|
|||||||
@ -203,12 +203,17 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
|||||||
|
|
||||||
$oFile = isset($_FILES['NewFile']) ? $_FILES['NewFile'] : $_FILES['upload'];
|
$oFile = isset($_FILES['NewFile']) ? $_FILES['NewFile'] : $_FILES['upload'];
|
||||||
|
|
||||||
|
// $resourceType should be 'Image';
|
||||||
|
$detectHtml = 0;
|
||||||
|
|
||||||
// Map the virtual path to the local server path.
|
// Map the virtual path to the local server path.
|
||||||
$sServerDir = ServerMapFolder($resourceType, $currentFolder, $sCommand);
|
$sServerDir = ServerMapFolder($resourceType, $currentFolder, $sCommand);
|
||||||
|
|
||||||
// Get the uploaded file name.
|
// Get the uploaded file name.
|
||||||
$sFileName = $oFile['name'];
|
$sFileName = $oFile['name'];
|
||||||
$sFileName = SanitizeFileName($sFileName);
|
|
||||||
|
//$sFileName = SanitizeFileName($sFileName);
|
||||||
|
$sFileName = dol_sanitizeFileName($sFileName);
|
||||||
|
|
||||||
$sOriginalFileName = $sFileName;
|
$sOriginalFileName = $sFileName;
|
||||||
|
|
||||||
@ -216,6 +221,8 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
|||||||
$sExtension = substr($sFileName, (strrpos($sFileName, '.') + 1));
|
$sExtension = substr($sFileName, (strrpos($sFileName, '.') + 1));
|
||||||
$sExtension = strtolower($sExtension);
|
$sExtension = strtolower($sExtension);
|
||||||
|
|
||||||
|
//var_dump($Config);
|
||||||
|
/*
|
||||||
if (isset($Config['SecureImageUploads'])) {
|
if (isset($Config['SecureImageUploads'])) {
|
||||||
if (($isImageValid = IsImageValid($oFile['tmp_name'], $sExtension)) === false) {
|
if (($isImageValid = IsImageValid($oFile['tmp_name'], $sExtension)) === false) {
|
||||||
$sErrorNumber = '202';
|
$sErrorNumber = '202';
|
||||||
@ -228,6 +235,14 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
|||||||
$sErrorNumber = '202';
|
$sErrorNumber = '202';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
|
$isImageValid = image_format_supported($sFileName) > 0 ? true : false;
|
||||||
|
if (!$isImageValid) {
|
||||||
|
$sErrorNumber = '202';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check if it is an allowed extension.
|
// Check if it is an allowed extension.
|
||||||
if (!$sErrorNumber && IsAllowedExt($sExtension, $resourceType)) {
|
if (!$sErrorNumber && IsAllowedExt($sExtension, $resourceType)) {
|
||||||
@ -241,7 +256,8 @@ function FileUpload($resourceType, $currentFolder, $sCommand, $CKEcallback = '')
|
|||||||
$sFileName = RemoveExtension($sOriginalFileName).'('.$iCounter.').'.$sExtension;
|
$sFileName = RemoveExtension($sOriginalFileName).'('.$iCounter.').'.$sExtension;
|
||||||
$sErrorNumber = '201';
|
$sErrorNumber = '201';
|
||||||
} else {
|
} else {
|
||||||
move_uploaded_file($oFile['tmp_name'], $sFilePath);
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
dol_move_uploaded_file($oFile['tmp_name'], $sFilePath, 0, 0);
|
||||||
|
|
||||||
if (is_file($sFilePath)) {
|
if (is_file($sFilePath)) {
|
||||||
if (isset($Config['ChmodOnUpload']) && !$Config['ChmodOnUpload']) {
|
if (isset($Config['ChmodOnUpload']) && !$Config['ChmodOnUpload']) {
|
||||||
|
|||||||
@ -408,6 +408,7 @@ EOF;
|
|||||||
}
|
}
|
||||||
|
|
||||||
$rpl = array('\\' => '\\\\', '"' => '\\"');
|
$rpl = array('\\' => '\\\\', '"' => '\\"');
|
||||||
|
echo 'console.log('.$errorNumber.');';
|
||||||
echo 'window.parent.OnUploadCompleted('.$errorNumber.', "'.strtr($fileUrl, $rpl).'", "'.strtr($fileName, $rpl).'", "'.strtr($customMsg, $rpl).'");';
|
echo 'window.parent.OnUploadCompleted('.$errorNumber.', "'.strtr($fileUrl, $rpl).'", "'.strtr($fileName, $rpl).'", "'.strtr($customMsg, $rpl).'");';
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -22,11 +22,12 @@
|
|||||||
* This is the "File Uploader" for PHP.
|
* This is the "File Uploader" for PHP.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require 'config.php';
|
require 'config.php'; // This include the main.inc.php
|
||||||
require 'util.php';
|
require 'util.php';
|
||||||
require 'io.php';
|
require 'io.php';
|
||||||
require 'commands.php';
|
require 'commands.php';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SendError
|
* SendError
|
||||||
*
|
*
|
||||||
@ -63,6 +64,7 @@ if (!IsAllowedType($sType)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// @CHANGE
|
// @CHANGE
|
||||||
//FileUpload( $sType, $sCurrentFolder, $sCommand )
|
//FileUpload( $sType, $sCurrentFolder, $sCommand )
|
||||||
|
|
||||||
|
|||||||
@ -8297,7 +8297,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
|
|||||||
* Verify if condition in string is ok or not
|
* Verify if condition in string is ok or not
|
||||||
*
|
*
|
||||||
* @param string $strToEvaluate String with condition to check
|
* @param string $strToEvaluate String with condition to check
|
||||||
* @return boolean True or False. Note: It returns also True if $strToEvaluate is ''
|
* @return boolean True or False. Note: It returns also True if $strToEvaluate is ''. False if error
|
||||||
*/
|
*/
|
||||||
function verifCond($strToEvaluate)
|
function verifCond($strToEvaluate)
|
||||||
{
|
{
|
||||||
@ -8310,8 +8310,10 @@ function verifCond($strToEvaluate)
|
|||||||
if (isset($strToEvaluate) && $strToEvaluate !== '') {
|
if (isset($strToEvaluate) && $strToEvaluate !== '') {
|
||||||
//$str = 'if(!('.$strToEvaluate.')) $rights = false;';
|
//$str = 'if(!('.$strToEvaluate.')) $rights = false;';
|
||||||
//dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition
|
//dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition
|
||||||
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx used into a condition
|
//var_dump($strToEvaluate);
|
||||||
$rights = ($rep ? true : false);
|
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition
|
||||||
|
$rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false);
|
||||||
|
//var_dump($rights);
|
||||||
}
|
}
|
||||||
return $rights;
|
return $rights;
|
||||||
}
|
}
|
||||||
@ -8323,7 +8325,7 @@ function verifCond($strToEvaluate)
|
|||||||
* @param string $s String to evaluate
|
* @param string $s String to evaluate
|
||||||
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
|
||||||
* @param int $hideerrors 1=Hide errors
|
* @param int $hideerrors 1=Hide errors
|
||||||
* @param string $onlysimplestring 0=Accept all chars, 1=Accept only simple string with char 'a-z0-9\s$_->&|=';, 2=Accept also '!?():";'
|
* @param string $onlysimplestring 0=Accept all chars, 1=Accept only simple string with char 'a-z0-9\s^$_->&|=!?():"\',/' and restrict use of (, 2=Accept also ';' and no restriction on (.
|
||||||
* @return mixed Nothing or return result of eval
|
* @return mixed Nothing or return result of eval
|
||||||
*/
|
*/
|
||||||
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
|
||||||
@ -8338,22 +8340,23 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||||||
global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
|
global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
|
||||||
global $soc; // For backward compatibility
|
global $soc; // For backward compatibility
|
||||||
|
|
||||||
// Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing.
|
// Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing
|
||||||
if ($onlysimplestring == '1') {
|
if ($onlysimplestring == '1') {
|
||||||
//print preg_quote('$_->&|', '/');
|
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
|
||||||
if (preg_match('/[^a-z0-9\s'.preg_quote('$_->&|=!?():"', '/').']/i', $s)) {
|
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
|
||||||
|
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/', '/').']/i', $s)) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||||
} else {
|
} else {
|
||||||
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
// TODO We can exclude all () that is not ...($db) and getDolGlobalInt( and getDolGlobalString(
|
// TODO We can exclude all () that is not '($db)' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match('
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
} elseif ($onlysimplestring == '2') {
|
} elseif ($onlysimplestring == '2') {
|
||||||
//print preg_quote('$_->&|', '/');
|
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
|
||||||
if (preg_match('/[^a-z0-9\s'.preg_quote('$_->&|=!?():";', '/').']/i', $s)) {
|
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/;[]', '/').']/i', $s)) {
|
||||||
if ($returnvalue) {
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
|
||||||
} else {
|
} else {
|
||||||
@ -8363,20 +8366,35 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (strpos($s, '::') !== false) {
|
if (strpos($s, '::') !== false) {
|
||||||
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Bad string syntax to evaluate (double : char is forbidden): '.$s);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (strpos($s, '`') !== false) {
|
if (strpos($s, '`') !== false) {
|
||||||
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (backtick char is forbidden): '.$s;
|
return 'Bad string syntax to evaluate (backtick char is forbidden): '.$s;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Bad string syntax to evaluate (backtick char is forbidden): '.$s);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (strpos($s, '.') !== false) {
|
if (strpos($s, '.') !== false) {
|
||||||
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
|
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We block use of php exec or php file functions
|
// We block use of php exec or php file functions
|
||||||
$forbiddenphpstrings = array('$$');
|
$forbiddenphpstrings = array('$$');
|
||||||
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
|
||||||
|
|
||||||
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI");
|
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", 'verifCond');
|
||||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
||||||
|
|
||||||
@ -8391,7 +8409,12 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||||||
|
|
||||||
if (strpos($s, '__forbiddenstring__') !== false) {
|
if (strpos($s, '__forbiddenstring__') !== false) {
|
||||||
dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING);
|
dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING);
|
||||||
|
if ($returnvalue) {
|
||||||
return 'Bad string syntax to evaluate: '.$s;
|
return 'Bad string syntax to evaluate: '.$s;
|
||||||
|
} else {
|
||||||
|
dol_syslog('Bad string syntax to evaluate: '.$s);
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//print $s."<br>\n";
|
//print $s."<br>\n";
|
||||||
@ -10119,7 +10142,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
$class = 'butAction';
|
$class = 'butAction';
|
||||||
if ($actionType == 'danger' || $actionType == 'delete') {
|
if ($actionType == 'danger' || $actionType == 'delete') {
|
||||||
$class = 'butActionDelete';
|
$class = 'butActionDelete';
|
||||||
if (strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
$attr = array(
|
$attr = array(
|
||||||
@ -10130,6 +10153,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
|
|
||||||
if (empty($html)) {
|
if (empty($html)) {
|
||||||
$html = $label;
|
$html = $label;
|
||||||
|
$attr['title'] = ''; // if html not set, leave label on title is redundant
|
||||||
} else {
|
} else {
|
||||||
$attr['aria-label'] = $label;
|
$attr['aria-label'] = $label;
|
||||||
}
|
}
|
||||||
@ -10143,6 +10167,7 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
$attr['id'] = $id;
|
$attr['id'] = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Override attr
|
// Override attr
|
||||||
if (!empty($params['attr']) && is_array($params['attr'])) {
|
if (!empty($params['attr']) && is_array($params['attr'])) {
|
||||||
foreach ($params['attr'] as $key => $value) {
|
foreach ($params['attr'] as $key => $value) {
|
||||||
@ -10156,6 +10181,11 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// automatic add tooltip when title is detected
|
||||||
|
if (!empty($attr['title']) && !empty($attr['class']) && strpos($attr['class'], 'classfortooltip') === false) {
|
||||||
|
$attr['class'].= ' classfortooltip';
|
||||||
|
}
|
||||||
|
|
||||||
// Js Confirm button
|
// Js Confirm button
|
||||||
if ($userRight && !empty($params['confirm'])) {
|
if ($userRight && !empty($params['confirm'])) {
|
||||||
if (!is_array($params['confirm'])) {
|
if (!is_array($params['confirm'])) {
|
||||||
|
|||||||
@ -1561,8 +1561,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
$disabledtask = 1;
|
$disabledtask = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form to add new time
|
// Select hour
|
||||||
print '<td class="nowrap leftborder center">';
|
print '<td class="nowraponall leftborder center minwidth150imp">';
|
||||||
$tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask);
|
$tableCell = $form->selectDate($preselectedday, $lines[$i]->id, 1, 1, 2, "addtime", 0, 0, $disabledtask);
|
||||||
print $tableCell;
|
print $tableCell;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -66,11 +66,29 @@ function tax_prepare_head(ChargeSociales $object)
|
|||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
|
$nbNote = 0;
|
||||||
|
if (!empty($object->note_private)) {
|
||||||
|
$nbNote++;
|
||||||
|
}
|
||||||
|
if (!empty($object->note_public)) {
|
||||||
|
$nbNote++;
|
||||||
|
}
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/note.php?id='.$object->id;
|
||||||
|
$head[$h][1] = $langs->trans('Notes');
|
||||||
|
if ($nbNote > 0) {
|
||||||
|
$head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : '');
|
||||||
|
}
|
||||||
|
$head[$h][2] = 'note';
|
||||||
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/info.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/info.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("Info");
|
$head[$h][1] = $langs->trans("Info");
|
||||||
$head[$h][2] = 'info';
|
$head[$h][2] = 'info';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
|
||||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'tax', 'remove');
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'tax', 'remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
|
|||||||
@ -126,8 +126,7 @@ abstract class ModeleNumRefChequeReceipts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class ModeleChequeReceipts
|
* Class parent for templates of document generation
|
||||||
* \brief Classe mere des modeles de
|
|
||||||
*/
|
*/
|
||||||
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -256,7 +256,7 @@ class modAccounting extends DolibarrModules
|
|||||||
$r++;
|
$r++;
|
||||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||||
$this->export_label[$r] = 'Chartofaccounts';
|
$this->export_label[$r] = 'Chartofaccounts';
|
||||||
$this->export_icon[$r] = 'accounting';
|
$this->export_icon[$r] = $this->picto;
|
||||||
$this->export_permission[$r] = array(array("accounting", "chartofaccount"));
|
$this->export_permission[$r] = array(array("accounting", "chartofaccount"));
|
||||||
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
|
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
|
||||||
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');
|
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');
|
||||||
|
|||||||
@ -33,7 +33,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
|||||||
*/
|
*/
|
||||||
class modBarcode extends DolibarrModules
|
class modBarcode extends DolibarrModules
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Define names, constants, directories, boxes, permissions
|
* Constructor. Define names, constants, directories, boxes, permissions
|
||||||
*
|
*
|
||||||
@ -94,6 +93,7 @@ class modBarcode extends DolibarrModules
|
|||||||
// Main menu entries
|
// Main menu entries
|
||||||
$r = 0;
|
$r = 0;
|
||||||
|
|
||||||
|
// A menu entry for the Tools top menu
|
||||||
$this->menu[$r] = array(
|
$this->menu[$r] = array(
|
||||||
'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
'mainmenu'=>'tools',
|
'mainmenu'=>'tools',
|
||||||
@ -111,6 +111,7 @@ class modBarcode extends DolibarrModules
|
|||||||
);
|
);
|
||||||
$r++;
|
$r++;
|
||||||
|
|
||||||
|
// A menu entry for the left menu
|
||||||
$this->menu[$r] = array(
|
$this->menu[$r] = array(
|
||||||
'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
'type'=>'left', // This is a Left menu entry
|
'type'=>'left', // This is a Left menu entry
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
/* Copyright (C) 2012 Nicolas Villa aka Boyquotes http://informetic.fr
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -98,7 +99,8 @@ class modCron extends DolibarrModules
|
|||||||
// Cronjobs
|
// Cronjobs
|
||||||
$this->cronjobs = array(
|
$this->cronjobs = array(
|
||||||
0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true),
|
0=>array('entity'=>0, 'label'=>'PurgeDeleteTemporaryFilesShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'purgeFiles', 'parameters'=>'tempfilesold+logfiles', 'comment'=>'PurgeDeleteTemporaryFiles', 'frequency'=>2, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>50, 'status'=>1, 'test'=>true),
|
||||||
1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>in_array($this->db->type, array('mysql', 'mysqli'))),
|
1=>array('entity'=>0, 'label'=>'MakeLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'dumpDatabase', 'parameters'=>'none,auto,1,auto,10', 'comment'=>'MakeLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>3600 * 24 * 7, 'priority'=>90, 'status'=>0, 'test'=>'in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
|
||||||
|
2=>array('entity'=>0, 'label'=>'MakeSendLocalDatabaseDumpShort', 'jobtype'=>'method', 'class'=>'core/class/utils.class.php', 'objectname'=>'Utils', 'method'=>'sendDumpDatabase', 'parameters'=>',,,,,sql', 'comment'=>'MakeSendLocalDatabaseDump', 'frequency'=>1, 'unitfrequency'=>604800, 'priority'=>91, 'status'=>0, 'test'=>'!empty($conf->global->MAIN_ALLOW_BACKUP_BY_EMAIL) && in_array($conf->db->type, array(\'mysql\', \'mysqli\'))'),
|
||||||
// 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
|
// 1=>array('entity'=>0, 'label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2012-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -480,7 +481,6 @@ class modSociete extends DolibarrModules
|
|||||||
's.fax' => "Fax",
|
's.fax' => "Fax",
|
||||||
's.url' => "Url",
|
's.url' => "Url",
|
||||||
's.email' => "Email",
|
's.email' => "Email",
|
||||||
's.skype' => "Skype",
|
|
||||||
's.fk_effectif' => "Staff",
|
's.fk_effectif' => "Staff",
|
||||||
's.fk_typent' => "ThirdPartyType",
|
's.fk_typent' => "ThirdPartyType",
|
||||||
"s.fk_forme_juridique" => "JuridicalStatus",
|
"s.fk_forme_juridique" => "JuridicalStatus",
|
||||||
@ -621,7 +621,6 @@ class modSociete extends DolibarrModules
|
|||||||
's.fax' => "eg. +34987654321",
|
's.fax' => "eg. +34987654321",
|
||||||
's.url' => "e.g. https://www.mybigcompany.com",
|
's.url' => "e.g. https://www.mybigcompany.com",
|
||||||
's.email' => "e.g. test@mybigcompany.com",
|
's.email' => "e.g. test@mybigcompany.com",
|
||||||
's.skype' => "Skype name",
|
|
||||||
's.fk_effectif' => "1/2/3/5: represents one of the five ranges of employees",
|
's.fk_effectif' => "1/2/3/5: represents one of the five ranges of employees",
|
||||||
's.fk_typent' => 'matches field "id" (1-9 etc.) OR "code" (TE_SMALL etc.) in table "'.MAIN_DB_PREFIX.'c_typent"',
|
's.fk_typent' => 'matches field "id" (1-9 etc.) OR "code" (TE_SMALL etc.) in table "'.MAIN_DB_PREFIX.'c_typent"',
|
||||||
's.fk_forme_juridique' => '1/2/3 etc...matches field "code" in table "'.MAIN_DB_PREFIX.'c_forme_juridique"',
|
's.fk_forme_juridique' => '1/2/3 etc...matches field "code" in table "'.MAIN_DB_PREFIX.'c_forme_juridique"',
|
||||||
@ -693,7 +692,6 @@ class modSociete extends DolibarrModules
|
|||||||
's.phone_mobile' => "PhoneMobile",
|
's.phone_mobile' => "PhoneMobile",
|
||||||
's.fax' => "Fax",
|
's.fax' => "Fax",
|
||||||
's.email' => "Email",
|
's.email' => "Email",
|
||||||
's.skype' => "Skype",
|
|
||||||
's.note_private' => "NotePrivate",
|
's.note_private' => "NotePrivate",
|
||||||
's.note_public' => "NotePublic"
|
's.note_public' => "NotePublic"
|
||||||
);
|
);
|
||||||
@ -759,7 +757,6 @@ class modSociete extends DolibarrModules
|
|||||||
's.phone_mobile' => "5551144",
|
's.phone_mobile' => "5551144",
|
||||||
's.fax' => "5551155",
|
's.fax' => "5551155",
|
||||||
's.email' => "johnsmith@email.com",
|
's.email' => "johnsmith@email.com",
|
||||||
's.skype' => "skype username",
|
|
||||||
's.note_private' => "My private note",
|
's.note_private' => "My private note",
|
||||||
's.note_public' => "My public note"
|
's.note_public' => "My public note"
|
||||||
);
|
);
|
||||||
|
|||||||
@ -109,7 +109,8 @@ class modTicket extends DolibarrModules
|
|||||||
3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0),
|
3 => array('TICKET_ADDON_PDF_ODT_PATH', 'chaine', 'DOL_DATA_ROOT/doctemplates/tickets', 'Ticket templates ODT/ODS directory for templates', 0),
|
||||||
4 => array('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0),
|
4 => array('TICKET_AUTO_READ_WHEN_CREATED_FROM_BACKEND', 'chaine', 0, 'Automatically mark ticket as read when created from backend', 0),
|
||||||
5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0),
|
5 => array('TICKET_DELAY_BEFORE_FIRST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time before a first answer to a ticket (in hours). Display a warning in tickets list if not respected.', 0),
|
||||||
6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0)
|
6 => array('TICKET_DELAY_SINCE_LAST_RESPONSE', 'chaine', '0', 'Maximum wanted elapsed time between two answers on the same ticket (in hours). Display a warning in tickets list if not respected.', 0),
|
||||||
|
7 => array('TICKET_NOTIFY_AT_CLOSING', 'chaine', '0', 'Default notify contacts when closing a module', 0),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,20 +43,18 @@ abstract class ModelePDFProduct extends CommonDocGenerator
|
|||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $dbs Database handler
|
||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
public static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($dbs, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$type = 'product';
|
$type = 'product';
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$list = getListOfModels($db, $type, $maxfilenamelength);
|
$list = getListOfModels($dbs, $type, $maxfilenamelength);
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,22 +154,22 @@ abstract class ModeleProductCode
|
|||||||
/**
|
/**
|
||||||
* Renvoi la liste des modeles de numérotation
|
* Renvoi la liste des modeles de numérotation
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $dbs Database handler
|
||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of numbers
|
* @return array List of numbers
|
||||||
*/
|
*/
|
||||||
public static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($dbs, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$list = array();
|
$list = array();
|
||||||
$sql = "";
|
$sql = "";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $dbs->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $dbs->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$row = $db->fetch_row($resql);
|
$row = $dbs->fetch_row($resql);
|
||||||
$list[$row[0]] = $row[1];
|
$list[$row[0]] = $row[1];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -432,10 +432,12 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
|
$pdf->MultiCell($this->posxlabel - $this->posxref, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
|
||||||
// Workload
|
// Workload
|
||||||
$pdf->SetXY($this->posxworkload, $curY);
|
$pdf->SetXY($this->posxworkload, $curY);
|
||||||
|
$pdf->SetFont('', '', $default_font_size - 2); // We use a smaller font
|
||||||
$pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $planned_workload ? $planned_workload : '', 0, 'R');
|
$pdf->MultiCell($this->posxprogress - $this->posxworkload, 3, $planned_workload ? $planned_workload : '', 0, 'R');
|
||||||
// Progress
|
// Progress
|
||||||
$pdf->SetXY($this->posxprogress, $curY);
|
$pdf->SetXY($this->posxprogress, $curY);
|
||||||
$pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, $progress, 0, 'R');
|
$pdf->MultiCell($this->posxdatestart - $this->posxprogress, 3, $progress, 0, 'R');
|
||||||
|
$pdf->SetFont('', '', $default_font_size - 1); // We restore font
|
||||||
|
|
||||||
// Date start and end
|
// Date start and end
|
||||||
$pdf->SetXY($this->posxdatestart, $curY);
|
$pdf->SetXY($this->posxdatestart, $curY);
|
||||||
@ -640,9 +642,11 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
$pdf->SetTextColor(0, 0, 60);
|
$pdf->SetTextColor(0, 0, 60);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : ".dol_print_date($object->date_start, 'day', false, $outputlangs, true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateStart")." : ".dol_print_date($object->date_start, 'day', false, $outputlangs, true), '', 'R');
|
||||||
|
|
||||||
|
if ($object->date_end) {
|
||||||
$posy += 6;
|
$posy += 6;
|
||||||
$pdf->SetXY($posx, $posy);
|
$pdf->SetXY($posx, $posy);
|
||||||
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : ".dol_print_date($object->date_end, 'day', false, $outputlangs, true), '', 'R');
|
$pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : ".dol_print_date($object->date_end, 'day', false, $outputlangs, true), '', 'R');
|
||||||
|
}
|
||||||
|
|
||||||
if (is_object($object->thirdparty)) {
|
if (is_object($object->thirdparty)) {
|
||||||
$posy += 6;
|
$posy += 6;
|
||||||
|
|||||||
@ -41,20 +41,19 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
|
|||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $dbs Database handler
|
||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
public static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($dbs, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
global $conf;
|
|
||||||
|
|
||||||
$type = 'company';
|
$type = 'company';
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
$list = getListOfModels($db, $type, $maxfilenamelength);
|
$list = getListOfModels($dbs, $type, $maxfilenamelength);
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
@ -161,22 +160,22 @@ abstract class ModeleThirdPartyCode
|
|||||||
/**
|
/**
|
||||||
* Renvoie la liste des modeles de numérotation
|
* Renvoie la liste des modeles de numérotation
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $dbs Database handler
|
||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array|int List of numbers
|
* @return array|int List of numbers
|
||||||
*/
|
*/
|
||||||
public static function liste_modeles($db, $maxfilenamelength = 0)
|
public static function liste_modeles($dbs, $maxfilenamelength = 0)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$list = array();
|
$list = array();
|
||||||
$sql = "";
|
$sql = "";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $dbs->query($sql);
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$num = $db->num_rows($resql);
|
$num = $dbs->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num) {
|
while ($i < $num) {
|
||||||
$row = $db->fetch_row($resql);
|
$row = $dbs->fetch_row($resql);
|
||||||
$list[$row[0]] = $row[1];
|
$list[$row[0]] = $row[1];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -401,26 +400,3 @@ abstract class ModeleAccountancyCode
|
|||||||
return $langs->trans("NotAvailable");
|
return $langs->trans("NotAvailable");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a document onto disk according to template module.
|
|
||||||
*
|
|
||||||
* @param DoliDB $db Database handler
|
|
||||||
* @param Facture $object Object invoice
|
|
||||||
* @param string $message Message (not used, deprecated)
|
|
||||||
* @param string $modele Force template to use ('' to not force)
|
|
||||||
* @param Translate $outputlangs objet lang a utiliser pour traduction
|
|
||||||
* @param int $hidedetails Hide details of lines
|
|
||||||
* @param int $hidedesc Hide description
|
|
||||||
* @param int $hideref Hide ref
|
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
* @deprecated Use the new function generateDocument of Objects class
|
|
||||||
* @see Societe::generateDocument()
|
|
||||||
*/
|
|
||||||
function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
|
||||||
{
|
|
||||||
dol_syslog(__METHOD__." is deprecated", LOG_WARNING);
|
|
||||||
|
|
||||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticket
|
|||||||
* Confirm form to delete a file
|
* Confirm form to delete a file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'deletefile') {
|
if ($action == 'deletefile' || $action == 'deletelink') {
|
||||||
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
|
$langs->load("companies"); // Need for string DeleteFile+ConfirmDeleteFiles
|
||||||
print $form->formconfirm(
|
print $form->formconfirm(
|
||||||
$_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param),
|
$_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode(GETPOST("urlfile")).'&linkid='.GETPOST('linkid', 'int').(empty($param) ? '' : $param),
|
||||||
|
|||||||
@ -212,14 +212,14 @@ if ($massaction == 'presend') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($massaction == 'preenable') {
|
if ($massaction == 'preenable') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, 'yes', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
if ($massaction == 'predisable') {
|
if ($massaction == 'predisable') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($massaction == 'preapproveleave') {
|
if ($massaction == 'preapproveleave') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
||||||
|
|||||||
@ -133,19 +133,145 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
|
|
||||||
$langs->load('ticket');
|
$langs->load('ticket');
|
||||||
|
|
||||||
|
$subject_admin = 'TicketNewEmailSubjectAdmin';
|
||||||
|
$body_admin = 'TicketNewEmailBodyAdmin';
|
||||||
|
$subject_customer = 'TicketNewEmailSubjectCustomer';
|
||||||
|
$body_customer = 'TicketNewEmailBodyCustomer';
|
||||||
|
$see_ticket_customer = 'TicketNewEmailBodyInfosTrackUrlCustomer';
|
||||||
|
|
||||||
// Send email to notification email
|
// Send email to notification email
|
||||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
|
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
|
||||||
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||||
|
if ($sendto) {
|
||||||
|
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send email to customer
|
||||||
|
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
|
||||||
|
$sendto = '';
|
||||||
|
|
||||||
|
//if contact selected send to email's contact else send to email's thirdparty
|
||||||
|
|
||||||
|
$contactid = GETPOST('contactid', 'alpha');
|
||||||
|
$res = 0;
|
||||||
|
|
||||||
|
if (!empty($contactid)) {
|
||||||
|
$contact = new Contact($this->db);
|
||||||
|
$res = $contact->fetch($contactid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
|
||||||
|
$sendto = $contact->email;
|
||||||
|
} elseif (!empty($object->fk_soc)) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$sendto = $object->thirdparty->email;
|
||||||
|
}
|
||||||
|
|
||||||
if ($sendto) {
|
if ($sendto) {
|
||||||
|
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$ok = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'TICKET_DELETE':
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'TICKET_MODIFY':
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'TICKET_CLOSE':
|
||||||
|
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||||
|
$langs->load('ticket');
|
||||||
|
|
||||||
|
$subject_admin = 'TicketCloseEmailSubjectAdmin';
|
||||||
|
$body_admin = 'TicketCloseEmailBodyAdmin';
|
||||||
|
$subject_customer = 'TicketCloseEmailSubjectCustomer';
|
||||||
|
$body_customer = 'TicketCloseEmailBodyCustomer';
|
||||||
|
$see_ticket_customer = 'TicketCloseEmailBodyInfosTrackUrlCustomer';
|
||||||
|
|
||||||
|
// Send email to notification email
|
||||||
|
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
|
||||||
|
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||||
|
if ($sendto) {
|
||||||
|
$this->composeAndSendAdminMessage($sendto, $subject_admin, $body_admin, $object, $langs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send email to customer.
|
||||||
|
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail'])) {
|
||||||
|
$linked_contacts = $object->listeContact(-1, 'thirdparty');
|
||||||
|
$linked_contacts = array_merge($linked_contacts, $object->listeContact(-1, 'internal'));
|
||||||
|
if (empty($linked_contacts) && !empty($conf->global->TICKET_NOTIFY_AT_CLOSING) && !empty($object->fk_soc)) {
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
$linked_contacts[] = $object->thirdparty->email;
|
||||||
|
}
|
||||||
|
|
||||||
|
$contactid = GETPOST('contactid', 'int');
|
||||||
|
$res = 0;
|
||||||
|
|
||||||
|
if ($contactid > 0) {
|
||||||
|
$contact = new Contact($this->db);
|
||||||
|
$res = $contact->fetch($contactid);
|
||||||
|
if (! in_array($contact, $linked_contacts)) {
|
||||||
|
$error_msg = $langs->trans('Error'). ': ';
|
||||||
|
$error_msg .= $langs->transnoentities('TicketWrongContact');
|
||||||
|
setEventMessages($error_msg, [], 'errors');
|
||||||
|
$ok = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sendto = '';
|
||||||
|
if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
|
||||||
|
$sendto = $contact->email;
|
||||||
|
} elseif ( !empty($linked_contacts) && ($contactid == -2 || (GETPOST('massaction', 'alpha') == 'close' && GETPOST('confirm', 'alpha') == 'yes'))) {
|
||||||
|
// if sending to all contacts or sending to contacts while mass closing
|
||||||
|
$temp_emails = [];
|
||||||
|
foreach ($linked_contacts as $contact) {
|
||||||
|
$temp_emails[] = $contact['email'];
|
||||||
|
}
|
||||||
|
$sendto = implode(", ", $temp_emails);
|
||||||
|
unset($temp_emails);
|
||||||
|
unset($linked_contacts);
|
||||||
|
}
|
||||||
|
if ($sendto) {
|
||||||
|
$this->composeAndSendCustomerMessage($sendto, $subject_customer, $body_customer, $see_ticket_customer, $object, $langs, $conf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ok = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Composes and sends a message concerning a ticket, to be sent to admin address.
|
||||||
|
*
|
||||||
|
* @param string $sendto Addresses to send the mail, format "first@address.net, second@address.net," etc.
|
||||||
|
* @param string $base_subject email subject. Non-translated string.
|
||||||
|
* @param string $body email body (first line). Non-translated string.
|
||||||
|
* @param Ticket $object the ticket thet the email refers to
|
||||||
|
* @param Translate $langs the translation object
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function composeAndSendAdminMessage($sendto, $base_subject, $body, Ticket $object, Translate $langs)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
// Init to avoid errors
|
// Init to avoid errors
|
||||||
$filepath = array();
|
$filepath = array();
|
||||||
$filename = array();
|
$filename = array();
|
||||||
$mimetype = array();
|
$mimetype = array();
|
||||||
|
|
||||||
/* Send email to admin */
|
/* Send email to admin */
|
||||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
|
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject, $object->ref, $object->track_id);
|
||||||
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
|
$message_admin = $langs->transnoentities($body, $object->track_id).'<br>';
|
||||||
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||||
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
|
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
|
||||||
$message_admin .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
|
$message_admin .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
|
||||||
@ -160,22 +286,20 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
$message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value, '', $object->table_element).'</li>';
|
$message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value, '', $object->table_element).'</li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$message_admin .= '</ul>';
|
|
||||||
|
|
||||||
if ($object->fk_soc > 0) {
|
if ($object->fk_soc > 0) {
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
$message_admin .= '<p>'.$langs->trans('Company').' : '.$object->thirdparty->name.'</p>';
|
$message_admin .= '<li>'.$langs->trans('Company').' : '.$object->thirdparty->name.'</li>';
|
||||||
}
|
}
|
||||||
|
$message_admin .= '</ul>';
|
||||||
|
|
||||||
$message = $object->message;
|
$message = $object->message;
|
||||||
if (!dol_textishtml($message)) {
|
if (!dol_textishtml($message)) {
|
||||||
$message = dol_nl2br($message);
|
$message = dol_nl2br($message);
|
||||||
}
|
}
|
||||||
$message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$message.'</p>';
|
$message_admin .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
|
||||||
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||||
|
|
||||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||||
$replyto = $from;
|
|
||||||
|
|
||||||
$trackid = 'tic'.$object->id;
|
$trackid = 'tic'.$object->id;
|
||||||
|
|
||||||
@ -194,43 +318,36 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
$conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send email to customer
|
/**
|
||||||
|
* Composes and sends a message concerning a ticket, to be sent to customer addresses.
|
||||||
|
*
|
||||||
|
* @param string $sendto Addresses to send the mail, format "first@address.net, second@address.net, " etc.
|
||||||
|
* @param string $base_subject email subject. Non-translated string.
|
||||||
|
* @param string $body email body (first line). Non-translated string.
|
||||||
|
* @param string $see_ticket string indicating the ticket public address
|
||||||
|
* @param Ticket $object the ticket thet the email refers to
|
||||||
|
* @param Translate $langs the translation object
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function composeAndSendCustomerMessage($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
|
||||||
|
{
|
||||||
|
global $conf, $user;
|
||||||
|
|
||||||
if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) {
|
|
||||||
$sendto = '';
|
|
||||||
|
|
||||||
//if contact selected send to email's contact else send to email's thirdparty
|
|
||||||
|
|
||||||
$contactid = GETPOST('contactid', 'alpha');
|
|
||||||
|
|
||||||
if (!empty($contactid)) {
|
|
||||||
$contact = new Contact($this->db);
|
|
||||||
$res = $contact->fetch($contactid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($res > 0 && !empty($contact->email) && !empty($contact->statut)) {
|
|
||||||
$sendto = $contact->email;
|
|
||||||
} elseif (!empty($object->fk_soc)) {
|
|
||||||
$object->fetch_thirdparty();
|
|
||||||
$sendto = $object->thirdparty->email;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sendto) {
|
|
||||||
// Init to avoid errors
|
// Init to avoid errors
|
||||||
$filepath = array();
|
$filepath = array();
|
||||||
$filename = array();
|
$filename = array();
|
||||||
$mimetype = array();
|
$mimetype = array();
|
||||||
|
|
||||||
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer');
|
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities($base_subject);
|
||||||
$message_customer = $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id).'<br><br>';
|
$message_customer = $langs->transnoentities($body, $object->track_id).'<br>';
|
||||||
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
|
||||||
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
|
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
|
||||||
$message_customer .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
|
$message_customer .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
|
||||||
$message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
|
$message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
|
||||||
|
|
||||||
// Extrafields
|
// Extrafields
|
||||||
|
if (is_array($this->attributes[$object->table_element]['label'])) {
|
||||||
foreach ($this->attributes[$object->table_element]['label'] as $key => $value) {
|
foreach ($this->attributes[$object->table_element]['label'] as $key => $value) {
|
||||||
$enabled = 1;
|
$enabled = 1;
|
||||||
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) {
|
if ($enabled && isset($this->attributes[$object->table_element]['list'][$key])) {
|
||||||
@ -253,6 +370,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
$message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
$message_customer .= '<li>' . $langs->trans($key) . ' : ' . $value . '</li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$message_customer .= '</ul>';
|
$message_customer .= '</ul>';
|
||||||
|
|
||||||
@ -260,13 +378,12 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
if (!dol_textishtml($message)) {
|
if (!dol_textishtml($message)) {
|
||||||
$message = dol_nl2br($message);
|
$message = dol_nl2br($message);
|
||||||
}
|
}
|
||||||
$message_customer .= '<p>'.$langs->trans('Message').' : <br>'.$message.'</p>';
|
$message_customer .= '<p>'.$langs->trans('Message').' : <br><br>'.$message.'</p><br>';
|
||||||
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
|
$url_public_ticket = ($conf->global->TICKET_URL_PUBLIC_INTERFACE ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/' : dol_buildpath('/public/ticket/view.php', 2)).'?track_id='.$object->track_id;
|
||||||
$message_customer .= '<p>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
$message_customer .= '<p>'.$langs->trans($see_ticket).' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
||||||
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
||||||
|
|
||||||
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||||
$replyto = $from;
|
|
||||||
|
|
||||||
$trackid = 'tic'.$object->id;
|
$trackid = 'tic'.$object->id;
|
||||||
|
|
||||||
@ -282,6 +399,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
$result = $mailfile->sendfile();
|
$result = $mailfile->sendfile();
|
||||||
if ($result) {
|
if ($result) {
|
||||||
// update last_msg_sent date
|
// update last_msg_sent date
|
||||||
|
$object->fetch($object->id);
|
||||||
$object->date_last_msg_sent = dol_now();
|
$object->date_last_msg_sent = dol_now();
|
||||||
$object->update($user);
|
$object->update($user);
|
||||||
}
|
}
|
||||||
@ -291,24 +409,3 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ok = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'TICKET_DELETE':
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'TICKET_MODIFY':
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'TICKET_CLOSE':
|
|
||||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return $ok;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -18,17 +18,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
|
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
|
||||||
* \ingroup zapier
|
* \ingroup zapier
|
||||||
* \brief Example trigger.
|
* \brief File for Zappier Triggers.
|
||||||
*
|
|
||||||
*
|
|
||||||
* \remarks You can create other triggers by copying this one.
|
|
||||||
* - File name should be either:
|
|
||||||
* - interface_99_modZapier_MyTrigger.class.php
|
|
||||||
* - interface_99_all_MyTrigger.class.php
|
|
||||||
* - The file must stay in core/triggers
|
|
||||||
* - The class name must be InterfaceMytrigger
|
|
||||||
* - The constructor method must be named InterfaceMytrigger
|
|
||||||
* - The name property name must be MyTrigger
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||||
|
|||||||
@ -478,9 +478,13 @@ if ($num > 0) {
|
|||||||
if (empty($obj)) {
|
if (empty($obj)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isset($obj->test) && !verifCond($obj->test)) {
|
|
||||||
|
if (isset($obj->test)) {
|
||||||
|
$veriftest = verifCond($obj->test);
|
||||||
|
if (!$veriftest) {
|
||||||
continue; // Discard line with test = false
|
continue; // Discard line with test = false
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$object->id = $obj->rowid;
|
$object->id = $obj->rowid;
|
||||||
$object->ref = $obj->rowid;
|
$object->ref = $obj->rowid;
|
||||||
|
|||||||
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
global $noMoreLinkedObjectBlockAfter;
|
global $noMoreLinkedObjectBlockAfter;
|
||||||
|
|||||||
@ -327,7 +327,11 @@ class EcmFiles extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
|
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
$this->errors[] = 'Error DB_ERROR_RECORD_ALREADY_EXISTS : '.$this->db->lasterror();
|
||||||
|
} else {
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
}
|
||||||
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedopjectblock.tpl.php -->\n";
|
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|
||||||
|
|||||||
@ -1208,6 +1208,7 @@ if ($action == 'create') {
|
|||||||
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
|
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
|
||||||
} else {
|
} else {
|
||||||
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
|
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
|
||||||
|
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
|
||||||
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
|
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -367,6 +367,7 @@ class Expedition extends CommonObject
|
|||||||
// Insert of lines
|
// Insert of lines
|
||||||
$num = count($this->lines);
|
$num = count($this->lines);
|
||||||
for ($i = 0; $i < $num; $i++) {
|
for ($i = 0; $i < $num; $i++) {
|
||||||
|
if (empty($this->lines[$i]->product_type) || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||||
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
|
||||||
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
@ -377,6 +378,7 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$error && $this->id && $this->origin_id) {
|
if (!$error && $this->id && $this->origin_id) {
|
||||||
$ret = $this->add_object_linked();
|
$ret = $this->add_object_linked();
|
||||||
@ -913,6 +915,7 @@ class Expedition extends CommonObject
|
|||||||
|
|
||||||
// Copy the rang of the order line to the expedition line
|
// Copy the rang of the order line to the expedition line
|
||||||
$line->rang = $orderline->rang;
|
$line->rang = $orderline->rang;
|
||||||
|
$line->product_type = $orderline->product_type;
|
||||||
|
|
||||||
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
|
||||||
$fk_product = $orderline->fk_product;
|
$fk_product = $orderline->fk_product;
|
||||||
@ -965,6 +968,8 @@ class Expedition extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->lines[$num] = $line;
|
$this->lines[$num] = $line;
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
@ -2611,6 +2616,12 @@ class ExpeditionLigne extends CommonObjectLine
|
|||||||
*/
|
*/
|
||||||
public $product_desc;
|
public $product_desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of the product. 0 for product, 1 for service
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
public $product_type = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int rang of line
|
* @var int rang of line
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE expensereport/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE expensereport/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE fichinter/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE fichinter/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -477,15 +477,15 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".((int) $this->socid);
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND l.qty >= pfp.quantity AND pfp.fk_soc = ".((int) $this->socid);
|
||||||
}
|
}
|
||||||
$sql .= " WHERE l.fk_commande = ".((int) $this->id);
|
$sql .= " WHERE l.fk_commande = ".((int) $this->id);
|
||||||
if ($only_product) {
|
if ($only_product) {
|
||||||
$sql .= ' AND p.fk_product_type = 0';
|
$sql .= ' AND p.fk_product_type = 0';
|
||||||
}
|
}
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$sql.= " AND l.qty >= pfp.quantity ";
|
$sql.= " GROUP BY l.rowid";
|
||||||
$sql.= " GROUP BY l.rowid HAVING max_qty = MAX(pfp.quantity) ";
|
$sql.= " HAVING (max_qty = MAX(pfp.quantity) OR max_qty IS NULL)";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY l.rang, l.rowid";
|
$sql .= " ORDER BY l.rang, l.rowid";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
@ -3552,11 +3552,11 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
|
||||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn AND cd.qty >= pfp.quantity";
|
||||||
}
|
}
|
||||||
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
|
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$sql .= " AND cd.qty >= pfp.quantity GROUP BY cd.rowid HAVING max_qty = MAX(pfp.quantity)";
|
$sql .= " GROUP BY cd.rowid HAVING (max_qty = MAX(pfp.quantity) OR max_qty IS NULL)";
|
||||||
}
|
}
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -245,7 +245,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
public $multicurrency_total_ht;
|
public $multicurrency_total_ht;
|
||||||
public $multicurrency_total_tva;
|
public $multicurrency_total_tva;
|
||||||
public $multicurrency_total_ttc;
|
public $multicurrency_total_ttc;
|
||||||
//! id of source var_dump($$this);invoice if replacement invoice or credit note
|
//! id of source invoice if replacement invoice or credit note
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "<!-- BEGIN PHP TEMPLATE fourn/facture/tpl/linkedopjectblock.tpl.php -->\n";
|
print "<!-- BEGIN PHP TEMPLATE fourn/facture/tpl/linkedobjectblock.tpl.php -->\n";
|
||||||
|
|
||||||
|
|
||||||
global $user;
|
global $user;
|
||||||
|
|||||||
@ -1083,7 +1083,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
if (empty($include_users)) {
|
if (empty($include_users)) {
|
||||||
print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
|
print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
|
||||||
} else {
|
} else {
|
||||||
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator); // Will work only if supervisor has permission to approve so is inside include_users
|
// Defined default approver (the forced approved of user or the supervisor if no forced value defined)
|
||||||
|
// Note: This use will be set only if the deinfed approvr has permission to approve so is inside include_users
|
||||||
|
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
|
||||||
if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
|
if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
|
||||||
$defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
|
$defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,10 +25,9 @@
|
|||||||
-- Availability type
|
-- Availability type
|
||||||
--
|
--
|
||||||
|
|
||||||
delete from llx_c_availability;
|
INSERT INTO llx_c_availability (code,label,active,position) VALUES ('AV_NOW', 'Immediate', 1, 10);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (1, 'AV_NOW', 'Immediate', 1, 10);
|
INSERT INTO llx_c_availability (code,label,active,position) VALUES ('AV_1W', '1 week', 1, 20);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (2, 'AV_1W', '1 week', 1, 20);
|
INSERT INTO llx_c_availability (code,label,active,position) VALUES ('AV_2W', '2 weeks', 1, 30);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (3, 'AV_2W', '2 weeks', 1, 30);
|
INSERT INTO llx_c_availability (code,label,active,position) VALUES ('AV_3W', '3 weeks', 1, 40);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (4, 'AV_3W', '3 weeks', 1, 40);
|
INSERT INTO llx_c_availability (code,label,active,position) VALUES ('AV_4W', '4 weeks', 1, 50);
|
||||||
INSERT INTO llx_c_availability (rowid,code,label,active,position) VALUES (5, 'AV_4W', '4 weeks', 1, 50);
|
|
||||||
|
|
||||||
|
|||||||
@ -30,9 +30,8 @@
|
|||||||
-- Civilities
|
-- Civilities
|
||||||
--
|
--
|
||||||
|
|
||||||
delete from llx_c_civility;
|
insert into llx_c_civility (code, label, active) values ('MME', 'Madame', 1);
|
||||||
insert into llx_c_civility (rowid, code, label, active) values (1 , 'MME', 'Madame', 1);
|
insert into llx_c_civility (code, label, active) values ('MR', 'Monsieur', 1);
|
||||||
insert into llx_c_civility (rowid, code, label, active) values (3 , 'MR', 'Monsieur', 1);
|
insert into llx_c_civility (code, label, active) values ('MLE', 'Mademoiselle', 1);
|
||||||
insert into llx_c_civility (rowid, code, label, active) values (5 , 'MLE', 'Mademoiselle', 1);
|
insert into llx_c_civility (code, label, active) values ('MTRE', 'Maître', 1);
|
||||||
insert into llx_c_civility (rowid, code, label, active) values (7 , 'MTRE', 'Maître', 1);
|
insert into llx_c_civility (code, label, active) values ('DR', 'Docteur', 1);
|
||||||
insert into llx_c_civility (rowid, code, label, active) values (8 , 'DR', 'Docteur', 1);
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
-- Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||||
-- Copyright (C) 2019 Markus Welters <markus@welters.de>
|
-- Copyright (C) 2019 Markus Welters <markus@welters.de>
|
||||||
|
-- Copyright (C) 2022 Joachim Kueter <jkueter@gmx.de>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- 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
|
-- it under the terms of the GNU General Public License as published by
|
||||||
@ -62,6 +63,24 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m
|
|||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-CONSTITUIZION', 0, 4, '', 0, 12, 6, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-CONSTITUIZION', 0, 4, '', 0, 12, 6, 1);
|
||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-IMMACULE', 0, 4, '', 0, 12, 8, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('ES-IMMACULE', 0, 4, '', 0, 12, 8, 1);
|
||||||
|
|
||||||
|
-- Germany (5)
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-NEUJAHR', 0, 5, '', 0, 1, 1, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-HL3KOEN--TLW', 0, 5, '', 0, 1, 6, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-INTFRAUENTAG--TLW', 0, 5, '', 0, 3, 8, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-KARFREITAG', 0, 5, 'goodfriday', 0, 0, 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-OSTERMONTAG', 0, 5, 'eastermonday', 0, 0, 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-TAGDERARBEIT', 0, 5, '', 0, 5, 1, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-HIMMELFAHRT', 0, 5, 'ascension', 0, 0, 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-PFINGSTEN', 0, 5, 'pentecotemonday', 0, 0, 0, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-FRONLEICHNAM--TLW', 0, 5, 'fronleichnam', 0, 0, 0, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-MARIAEHIMMEL--TLW', 0, 5, '', 0, 8, 15, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-WELTKINDERTAG--TLW', 0, 5, '', 0, 9, 20, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-TAGDERDEUTEINHEIT', 0, 5, '', 0, 10, 3, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-REFORMATIONSTAG--TLW', 0, 5, '', 0, 10, 31, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-ALLERHEILIGEN--TLW', 0, 5, '', 0, 11, 1, 0);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-WEIHNACHTSTAG1', 0, 5, '', 0, 12, 25, 1);
|
||||||
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('DE-WEIHNACHTSTAG2', 0, 5, '', 0, 12, 26, 1);
|
||||||
|
|
||||||
-- Austria (41)
|
-- Austria (41)
|
||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-EASTER', 0, 41, 'eastermonday', 0, 0, 0, 1);
|
||||||
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1);
|
INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-ASCENSION', 0, 41, 'ascension', 0, 0, 0, 1);
|
||||||
|
|||||||
@ -43,6 +43,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
|
|||||||
|
|
||||||
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
|
||||||
|
|
||||||
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
|
||||||
|
|
||||||
create table llx_c_shipment_package_type
|
create table llx_c_shipment_package_type
|
||||||
|
|||||||
@ -566,7 +566,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
|
|||||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
|
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
|
||||||
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
|
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
|
||||||
|
|
||||||
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||||
|
|
||||||
|
|||||||
@ -84,6 +84,9 @@ UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'a
|
|||||||
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
|
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
|
||||||
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
|
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
|
||||||
|
|
||||||
-- For v14
|
-- For v14
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,9 @@
|
|||||||
-- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL;
|
-- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL;
|
||||||
-- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL;
|
-- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL;
|
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL;
|
||||||
|
|
||||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;
|
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;
|
||||||
|
|||||||
@ -276,3 +276,12 @@ UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SEL
|
|||||||
|
|
||||||
ALTER TABLE llx_user ADD COLUMN ref_employee varchar(50) DEFAULT NULL;
|
ALTER TABLE llx_user ADD COLUMN ref_employee varchar(50) DEFAULT NULL;
|
||||||
ALTER TABLE llx_user ADD COLUMN national_registration_number varchar(50) DEFAULT NULL;
|
ALTER TABLE llx_user ADD COLUMN national_registration_number varchar(50) DEFAULT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_propal ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
|
||||||
|
|
||||||
|
UPDATE llx_c_country SET eec=0 WHERE eec IS NULL;
|
||||||
|
ALTER TABLE llx_c_country MODIFY COLUMN eec tinyint DEFAULT 0 NOT NULL;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE llx_chargesociales ADD COLUMN note_private text;
|
||||||
|
ALTER TABLE llx_chargesociales ADD COLUMN note_public text;
|
||||||
|
|||||||
@ -25,7 +25,7 @@ create table llx_c_country
|
|||||||
code varchar(2) NOT NULL,
|
code varchar(2) NOT NULL,
|
||||||
code_iso varchar(3) ,
|
code_iso varchar(3) ,
|
||||||
label varchar(128) NOT NULL,
|
label varchar(128) NOT NULL,
|
||||||
eec integer ,
|
eec tinyint DEFAULT 0 NOT NULL,
|
||||||
active tinyint DEFAULT 1 NOT NULL,
|
active tinyint DEFAULT 1 NOT NULL,
|
||||||
favorite tinyint DEFAULT 0 NOT NULL
|
favorite tinyint DEFAULT 0 NOT NULL
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|||||||
20
htdocs/install/mysql/tables/llx_chargesociales.key.sql
Normal file
20
htdocs/install/mysql/tables/llx_chargesociales.key.sql
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
-- ===================================================================
|
||||||
|
-- Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- 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 <https://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
-- ===================================================================
|
||||||
|
|
||||||
|
|
||||||
|
--ALTER TABLE llx_chargesociales ADD INDEX idx_chargesociales (ref);
|
||||||
@ -3,6 +3,7 @@
|
|||||||
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
-- Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
-- Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
-- Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||||
|
-- Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
--
|
--
|
||||||
-- This program is free software; you can redistribute it and/or modify
|
-- 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
|
-- it under the terms of the GNU General Public License as published by
|
||||||
@ -40,6 +41,8 @@ create table llx_chargesociales
|
|||||||
paye smallint default 0 NOT NULL,
|
paye smallint default 0 NOT NULL,
|
||||||
periode date,
|
periode date,
|
||||||
fk_projet integer DEFAULT NULL,
|
fk_projet integer DEFAULT NULL,
|
||||||
|
note_private text,
|
||||||
|
note_public text,
|
||||||
import_key varchar(14)
|
import_key varchar(14)
|
||||||
)ENGINE=innodb;
|
)ENGINE=innodb;
|
||||||
|
|
||||||
|
|||||||
@ -50,8 +50,7 @@ create table llx_product_fournisseur_price
|
|||||||
import_key varchar(14), -- Import key
|
import_key varchar(14), -- Import key
|
||||||
delivery_time_days integer,
|
delivery_time_days integer,
|
||||||
supplier_reputation varchar(10),
|
supplier_reputation varchar(10),
|
||||||
packaging varchar(64),
|
packaging varchar(64) DEFAULT NULL,
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(3),
|
multicurrency_code varchar(3),
|
||||||
multicurrency_tx double(24,8) DEFAULT 1,
|
multicurrency_tx double(24,8) DEFAULT 1,
|
||||||
|
|||||||
@ -78,6 +78,7 @@ create table llx_societe
|
|||||||
note_private text, --
|
note_private text, --
|
||||||
note_public text, --
|
note_public text, --
|
||||||
model_pdf varchar(255),
|
model_pdf varchar(255),
|
||||||
|
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
|
||||||
prefix_comm varchar(5), -- prefix commercial (deprecated)
|
prefix_comm varchar(5), -- prefix commercial (deprecated)
|
||||||
client tinyint DEFAULT 0, -- client 0/1/2
|
client tinyint DEFAULT 0, -- client 0/1/2
|
||||||
fournisseur tinyint DEFAULT 0, -- fournisseur 0/1
|
fournisseur tinyint DEFAULT 0, -- fournisseur 0/1
|
||||||
|
|||||||
@ -219,12 +219,12 @@ ByPredefinedAccountGroups=By predefined groups
|
|||||||
ByPersonalizedAccountGroups=By personalized groups
|
ByPersonalizedAccountGroups=By personalized groups
|
||||||
ByYear=By year
|
ByYear=By year
|
||||||
NotMatch=Not Set
|
NotMatch=Not Set
|
||||||
DeleteMvt=Delete some operation lines from accounting
|
DeleteMvt=Delete some lines from accounting
|
||||||
DelMonth=Month to delete
|
DelMonth=Month to delete
|
||||||
DelYear=Year to delete
|
DelYear=Year to delete
|
||||||
DelJournal=Journal to delete
|
DelJournal=Journal to delete
|
||||||
ConfirmDeleteMvt=This will delete all operation lines of the accounting for the year/month and/or for a specific journal (At least one criterion is required). You will have to reuse the feature '%s' to have the deleted record back in the ledger.
|
ConfirmDeleteMvt=This will delete all lines in accountancy for the year/month and/or for a specific journal (At least one criterion is required). You will have to reuse the feature '%s' to have the deleted record back in the ledger.
|
||||||
ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all operation lines related to the same transaction will be deleted)
|
ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all lines related to the same transaction will be deleted)
|
||||||
FinanceJournal=Finance journal
|
FinanceJournal=Finance journal
|
||||||
ExpenseReportsJournal=Expense reports journal
|
ExpenseReportsJournal=Expense reports journal
|
||||||
DescFinanceJournal=Finance journal including all the types of payments by bank account
|
DescFinanceJournal=Finance journal including all the types of payments by bank account
|
||||||
@ -282,7 +282,7 @@ DescClosure=Consult here the number of movements by month who are not validated
|
|||||||
OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year)
|
OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year)
|
||||||
AllMovementsWereRecordedAsValidated=All movements were recorded as validated
|
AllMovementsWereRecordedAsValidated=All movements were recorded as validated
|
||||||
NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated
|
NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated
|
||||||
ValidateMovements=Validate movements
|
ValidateMovements=Validate and lock record...
|
||||||
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
|
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
|
||||||
|
|
||||||
ValidateHistory=Bind Automatically
|
ValidateHistory=Bind Automatically
|
||||||
@ -301,7 +301,7 @@ Accounted=Accounted in ledger
|
|||||||
NotYetAccounted=Not yet transferred to accounting
|
NotYetAccounted=Not yet transferred to accounting
|
||||||
ShowTutorial=Show Tutorial
|
ShowTutorial=Show Tutorial
|
||||||
NotReconciled=Not reconciled
|
NotReconciled=Not reconciled
|
||||||
WarningRecordWithoutSubledgerAreExcluded=Warning, all operations without subledger account defined are filtered and excluded from this view
|
WarningRecordWithoutSubledgerAreExcluded=Warning, all lines without subledger account defined are filtered and excluded from this view
|
||||||
|
|
||||||
## Admin
|
## Admin
|
||||||
BindingOptions=Binding options
|
BindingOptions=Binding options
|
||||||
@ -329,8 +329,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc
|
|||||||
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
|
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
|
||||||
|
|
||||||
## Export
|
## Export
|
||||||
NotifiedExportDate=Flag exported lines as exported (modification of the lines will not be possible)
|
NotifiedExportDate=Flag exported lines as Exported <span class="warning">(to modify a line, you will need to delete the whole transaction and re-transfert it into accounting)</span>
|
||||||
NotifiedValidationDate=Validate the exported entries (modification or deletion of the lines will not be possible)
|
NotifiedValidationDate=Validate and Lock the exported entries <span class="warning">(same effect than the "Closure" feature, modification and deletion of the lines will DEFINITELY not be possible)</span>
|
||||||
|
DateValidationAndLock=Date validation and lock
|
||||||
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
|
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
|
||||||
ExportDraftJournal=Export draft journal
|
ExportDraftJournal=Export draft journal
|
||||||
Modelcsv=Model of export
|
Modelcsv=Model of export
|
||||||
|
|||||||
@ -82,6 +82,8 @@ UseMenuModuleToolsToAddCronJobs=Go into menu "<a href="%s">Home - Admin tools -
|
|||||||
JobDisabled=Job disabled
|
JobDisabled=Job disabled
|
||||||
MakeLocalDatabaseDumpShort=Local database backup
|
MakeLocalDatabaseDumpShort=Local database backup
|
||||||
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
MakeLocalDatabaseDump=Create a local database dump. Parameters are: compression ('gz' or 'bz' or 'none'), backup type ('mysql', 'pgsql', 'auto'), 1, 'auto' or filename to build, number of backup files to keep
|
||||||
|
MakeSendLocalDatabaseDumpShort=Send local database backup
|
||||||
|
MakeSendLocalDatabaseDump=Send local database backup by email. Parameters are: to, from, subject, message, filename (Name of file sent), filter ('sql' for backup of database only)
|
||||||
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
WarningCronDelayed=Attention, for performance purpose, whatever is next date of execution of enabled jobs, your jobs may be delayed to a maximum of %s hours, before being run.
|
||||||
DATAPOLICYJob=Data cleaner and anonymizer
|
DATAPOLICYJob=Data cleaner and anonymizer
|
||||||
JobXMustBeEnabled=Job %s must be enabled
|
JobXMustBeEnabled=Job %s must be enabled
|
||||||
|
|||||||
@ -278,6 +278,7 @@ ErrorIsNotADraft=%s is not a draft
|
|||||||
ErrorExecIdFailed=Can't execute command "id"
|
ErrorExecIdFailed=Can't execute command "id"
|
||||||
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
||||||
ErrorRequestTooLarge=Error, request too large
|
ErrorRequestTooLarge=Error, request too large
|
||||||
|
ErrorNotApproverForHoliday=You are not the approver for leave %s
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||||
|
|||||||
@ -94,7 +94,7 @@ LanguageDefDesc=Enter in this files, all the key and the translation for each la
|
|||||||
MenusDefDesc=Define here the menus provided by your module
|
MenusDefDesc=Define here the menus provided by your module
|
||||||
DictionariesDefDesc=Define here the dictionaries provided by your module
|
DictionariesDefDesc=Define here the dictionaries provided by your module
|
||||||
PermissionsDefDesc=Define here the new permissions provided by your module
|
PermissionsDefDesc=Define here the new permissions provided by your module
|
||||||
MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), menus are also visible into the menu editor available to administrator users on %s.
|
MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and the module re-activated), the menus are also visible into the menu editor available to administrator users on %s.
|
||||||
DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
|
DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
|
||||||
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
|
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
|
||||||
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
|
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
|
||||||
@ -110,7 +110,7 @@ DropTableIfEmpty=(Destroy table if empty)
|
|||||||
TableDoesNotExists=The table %s does not exists
|
TableDoesNotExists=The table %s does not exists
|
||||||
TableDropped=Table %s deleted
|
TableDropped=Table %s deleted
|
||||||
InitStructureFromExistingTable=Build the structure array string of an existing table
|
InitStructureFromExistingTable=Build the structure array string of an existing table
|
||||||
UseAboutPage=Disable the about page
|
UseAboutPage=Do not generate the About page
|
||||||
UseDocFolder=Disable the documentation folder
|
UseDocFolder=Disable the documentation folder
|
||||||
UseSpecificReadme=Use a specific ReadMe
|
UseSpecificReadme=Use a specific ReadMe
|
||||||
ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder.
|
ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder.
|
||||||
@ -138,10 +138,12 @@ CSSViewClass=CSS for read form
|
|||||||
CSSListClass=CSS for list
|
CSSListClass=CSS for list
|
||||||
NotEditable=Not editable
|
NotEditable=Not editable
|
||||||
ForeignKey=Foreign key
|
ForeignKey=Foreign key
|
||||||
TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example)
|
TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]<br>'1' means we add a + button after the combo to create the record<br>'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)'
|
||||||
AsciiToHtmlConverter=Ascii to HTML converter
|
AsciiToHtmlConverter=Ascii to HTML converter
|
||||||
AsciiToPdfConverter=Ascii to PDF converter
|
AsciiToPdfConverter=Ascii to PDF converter
|
||||||
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
||||||
ModuleBuilderNotAllowed=The module builder is available but not allowed to your user.
|
ModuleBuilderNotAllowed=The module builder is available but not allowed to your user.
|
||||||
ImportExportProfiles=Import and export profiles
|
ImportExportProfiles=Import and export profiles
|
||||||
ValidateModBuilderDesc=Put 1 if this field need to be validated with $this->validateField() or 0 if validation required
|
ValidateModBuilderDesc=Put 1 if this field need to be validated with $this->validateField() or 0 if validation required
|
||||||
|
WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated
|
||||||
|
LinkToParentMenu=Parent menu (fk_xxxxmenu)
|
||||||
@ -346,7 +346,7 @@ UseProductFournDesc=Add a feature to define the product description defined by t
|
|||||||
ProductSupplierDescription=Vendor description for the product
|
ProductSupplierDescription=Vendor description for the product
|
||||||
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
|
UseProductSupplierPackaging=Use packaging on supplier prices (recalculate quantities according to packaging set on supplier price when adding/updating line in supplier documents)
|
||||||
PackagingForThisProduct=Packaging
|
PackagingForThisProduct=Packaging
|
||||||
PackagingForThisProductDesc=On supplier order, you will automaticly order this quantity (or a multiple of this quantity). Cannot be less than minimum buying quantity
|
PackagingForThisProductDesc=You will automaticaly buy a multiple of this quantity. Can't be lower than the minimum purchase quantity
|
||||||
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
|
QtyRecalculatedWithPackaging=The quantity of the line were recalculated according to supplier packaging
|
||||||
|
|
||||||
#Attributes
|
#Attributes
|
||||||
|
|||||||
@ -142,6 +142,9 @@ TicketsDelayBeforeFirstAnswer=A new ticket should receive a first answer before
|
|||||||
TicketsDelayBeforeFirstAnswerHelp=If a new ticket has not received an answer after this time period (in hours), an important warning icon will be displayed in the list view.
|
TicketsDelayBeforeFirstAnswerHelp=If a new ticket has not received an answer after this time period (in hours), an important warning icon will be displayed in the list view.
|
||||||
TicketsDelayBetweenAnswers=An unresolved ticket should not be unactive during (hours):
|
TicketsDelayBetweenAnswers=An unresolved ticket should not be unactive during (hours):
|
||||||
TicketsDelayBetweenAnswersHelp=If an unresolved ticket that has already received an answer has not had further interaction after this time period (in hours), a warning icon will be displayed in the list view.
|
TicketsDelayBetweenAnswersHelp=If an unresolved ticket that has already received an answer has not had further interaction after this time period (in hours), a warning icon will be displayed in the list view.
|
||||||
|
TicketsAutoNotifyClose=Automatically notify thirdparty when closing a ticket
|
||||||
|
TicketsAutoNotifyCloseHelp=When closing a ticket, you will be proposed to send a message to one of thirdparty's contacts. On mass closing, a message will be sent to one contact of the thirdparty linked to the ticket.
|
||||||
|
TicketWrongContact=Provided contact is not part of current ticket contacts. Email not sent.
|
||||||
|
|
||||||
#
|
#
|
||||||
# Index & list page
|
# Index & list page
|
||||||
@ -158,6 +161,8 @@ OrderByDateAsc=Sort by ascending date
|
|||||||
OrderByDateDesc=Sort by descending date
|
OrderByDateDesc=Sort by descending date
|
||||||
ShowAsConversation=Show as conversation list
|
ShowAsConversation=Show as conversation list
|
||||||
MessageListViewType=Show as table list
|
MessageListViewType=Show as table list
|
||||||
|
ConfirmMassTicketClosingSendEmail=Automatically send emails when closing tickets
|
||||||
|
ConfirmMassTicketClosingSendEmailQuestion=Do you want to notify thirdparties when closing these tickets ?
|
||||||
|
|
||||||
#
|
#
|
||||||
# Ticket card
|
# Ticket card
|
||||||
@ -245,6 +250,9 @@ TicketChangeStatus=Change status
|
|||||||
TicketConfirmChangeStatus=Confirm the status change: %s ?
|
TicketConfirmChangeStatus=Confirm the status change: %s ?
|
||||||
TicketLogStatusChanged=Status changed: %s to %s
|
TicketLogStatusChanged=Status changed: %s to %s
|
||||||
TicketNotNotifyTiersAtCreate=Not notify company at create
|
TicketNotNotifyTiersAtCreate=Not notify company at create
|
||||||
|
NotifyThirdpartyOnTicketClosing=Contacts to notify while closing the ticket
|
||||||
|
TicketNotifyAllTiersAtClose=All related contacts
|
||||||
|
TicketNotNotifyTiersAtClose=No related contact
|
||||||
Unread=Unread
|
Unread=Unread
|
||||||
TicketNotCreatedFromPublicInterface=Not available. Ticket was not created from public interface.
|
TicketNotCreatedFromPublicInterface=Not available. Ticket was not created from public interface.
|
||||||
ErrorTicketRefRequired=Ticket reference name is required
|
ErrorTicketRefRequired=Ticket reference name is required
|
||||||
@ -279,6 +287,7 @@ TicketNewEmailBodyInfosTicket=Information for monitoring the ticket
|
|||||||
TicketNewEmailBodyInfosTrackId=Ticket tracking number: %s
|
TicketNewEmailBodyInfosTrackId=Ticket tracking number: %s
|
||||||
TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above.
|
TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above.
|
||||||
TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link
|
TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link
|
||||||
|
TicketCloseEmailBodyInfosTrackUrlCustomer=You can consult the history of this ticket by clicking the following link
|
||||||
TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface.
|
TicketEmailPleaseDoNotReplyToThisEmail=Please do not reply directly to this email! Use the link to reply into the interface.
|
||||||
TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system.
|
TicketPublicInfoCreateTicket=This form allows you to record a support ticket in our management system.
|
||||||
TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request.
|
TicketPublicPleaseBeAccuratelyDescribe=Please accurately describe the problem. Provide the most information possible to allow us to correctly identify your request.
|
||||||
@ -300,6 +309,10 @@ NewUser=New user
|
|||||||
NumberOfTicketsByMonth=Number of tickets per month
|
NumberOfTicketsByMonth=Number of tickets per month
|
||||||
NbOfTickets=Number of tickets
|
NbOfTickets=Number of tickets
|
||||||
# notifications
|
# notifications
|
||||||
|
TicketCloseEmailSubjectCustomer=Ticket closed
|
||||||
|
TicketCloseEmailBodyCustomer=This is an automatic message to notify you that ticket %s has just been closed.
|
||||||
|
TicketCloseEmailSubjectAdmin=Ticket closed - Réf %s (public ticket ID %s)
|
||||||
|
TicketCloseEmailBodyAdmin=A ticket with ID #%s has just been closed, see information:
|
||||||
TicketNotificationEmailSubject=Ticket %s updated
|
TicketNotificationEmailSubject=Ticket %s updated
|
||||||
TicketNotificationEmailBody=This is an automatic message to notify you that ticket %s has just been updated
|
TicketNotificationEmailBody=This is an automatic message to notify you that ticket %s has just been updated
|
||||||
TicketNotificationRecipient=Notification recipient
|
TicketNotificationRecipient=Notification recipient
|
||||||
|
|||||||
@ -120,7 +120,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("UseAboutPage").'</td>';
|
print '<td>'.$langs->trans("UseAboutPage").'</td>';
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
|
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -955,6 +955,21 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
|||||||
if ($fieldname == 'entity') {
|
if ($fieldname == 'entity') {
|
||||||
$index = 1;
|
$index = 1;
|
||||||
}
|
}
|
||||||
|
// css
|
||||||
|
$css = '';
|
||||||
|
$cssview = '';
|
||||||
|
$csslist = '';
|
||||||
|
if (preg_match('/^fk_/', $fieldname)) {
|
||||||
|
$css = 'maxwidth500 widthcentpercentminusxx';
|
||||||
|
}
|
||||||
|
if ($fieldname == 'label') {
|
||||||
|
$css = 'minwidth300';
|
||||||
|
$cssview = 'wordbreak';
|
||||||
|
}
|
||||||
|
if (in_array($fieldname, array('note_public', 'note_private'))) {
|
||||||
|
$cssview = 'wordbreak';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$string .= "'".$obj->Field."' =>array('type'=>'".$type."', 'label'=>'".$label."',";
|
$string .= "'".$obj->Field."' =>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||||
if ($default != '') {
|
if ($default != '') {
|
||||||
@ -972,6 +987,15 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
|||||||
if ($index) {
|
if ($index) {
|
||||||
$string .= ", 'index'=>".$index;
|
$string .= ", 'index'=>".$index;
|
||||||
}
|
}
|
||||||
|
if ($css) {
|
||||||
|
$string .= ", 'css'=>".$css;
|
||||||
|
}
|
||||||
|
if ($cssview) {
|
||||||
|
$string .= ", 'cssview'=>".$cssview;
|
||||||
|
}
|
||||||
|
if ($csslist) {
|
||||||
|
$string .= ", 'csslist'=>".$csslist;
|
||||||
|
}
|
||||||
$string .= "),\n";
|
$string .= "),\n";
|
||||||
$string .= "<br>";
|
$string .= "<br>";
|
||||||
$i += 5;
|
$i += 5;
|
||||||
@ -1307,7 +1331,6 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$addfieldentry = array(
|
$addfieldentry = array(
|
||||||
@ -1324,9 +1347,9 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||||
'help'=>GETPOST('prophelp', 'alpha'),
|
'help'=>GETPOST('prophelp', 'alpha'),
|
||||||
'css'=>GETPOST('propcss', 'aZ09'),
|
'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
|
||||||
'cssview'=>GETPOST('propcssview', 'aZ09'),
|
'cssview'=>GETPOST('propcssview', 'alpha'),
|
||||||
'csslist'=>GETPOST('propcsslist', 'aZ09'),
|
'csslist'=>GETPOST('propcsslist', 'alpha'),
|
||||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||||
'validate' => GETPOST('propvalidate', 'int')
|
'validate' => GETPOST('propvalidate', 'int')
|
||||||
@ -1336,6 +1359,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*if (GETPOST('regeneratemissing'))
|
/*if (GETPOST('regeneratemissing'))
|
||||||
{
|
{
|
||||||
@ -1346,8 +1370,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
// Edit the class file to write properties
|
// Edit the class file to write properties
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$moduletype = 'external';
|
$moduletype = 'external';
|
||||||
|
|
||||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
||||||
|
|
||||||
if (is_numeric($object) && $object <= 0) {
|
if (is_numeric($object) && $object <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -1366,6 +1390,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);
|
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);
|
||||||
|
|
||||||
|
setEventMessages($langs->trans('WarningDatabaseIsNotUpdated'), null);
|
||||||
|
|
||||||
clearstatcache(true);
|
clearstatcache(true);
|
||||||
|
|
||||||
// Make a redirect to reload all data
|
// Make a redirect to reload all data
|
||||||
@ -1940,6 +1966,11 @@ if ($module == 'initmodule') {
|
|||||||
$head2[$h][2] = 'description';
|
$head2[$h][2] = 'description';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
|
$head2[$h][1] = $langs->trans("Objects");
|
||||||
|
$head2[$h][2] = 'objects';
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : '');
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
$head2[$h][1] = $langs->trans("Languages");
|
$head2[$h][1] = $langs->trans("Languages");
|
||||||
$head2[$h][2] = 'languages';
|
$head2[$h][2] = 'languages';
|
||||||
@ -1950,11 +1981,6 @@ if ($module == 'initmodule') {
|
|||||||
$head2[$h][2] = 'dictionaries';
|
$head2[$h][2] = 'dictionaries';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '');
|
|
||||||
$head2[$h][1] = $langs->trans("Objects");
|
|
||||||
$head2[$h][2] = 'objects';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : '');
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
$head2[$h][1] = $langs->trans("Permissions");
|
$head2[$h][1] = $langs->trans("Permissions");
|
||||||
$head2[$h][2] = 'permissions';
|
$head2[$h][2] = 'permissions';
|
||||||
@ -2287,7 +2313,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<table class="noborder">';
|
print '<table class="noborder">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("#", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, ' aaa ');
|
||||||
print_liste_field_titre("Table", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Table", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("SQL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("SQL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
@ -2537,8 +2563,9 @@ if ($module == 'initmodule') {
|
|||||||
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
||||||
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||||
}
|
}
|
||||||
$urloflist = $dirread.'/'.$pathtolist;
|
|
||||||
$urlofcard = $dirread.'/'.$pathtocard;
|
$urloflist = dol_buildpath('/'.$pathtolist, 1);
|
||||||
|
$urlofcard = dol_buildpath('/'.$pathtocard, 1);
|
||||||
|
|
||||||
print '<div class="fichehalfleft smallxxx">';
|
print '<div class="fichehalfleft smallxxx">';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).($realpathtoclass ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).($realpathtoclass ? '' : '</strike>').'</strong>';
|
||||||
@ -2699,7 +2726,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder small">';
|
print '<table class="noborder small">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Property");
|
print '<th class="thsticky thstickygray">'.$langs->trans("Property");
|
||||||
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeExamples").'</a>)';
|
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeExamples").'</a>)';
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th>';
|
print '<th>';
|
||||||
@ -2725,7 +2752,7 @@ if ($module == 'initmodule') {
|
|||||||
//print '<th class="center">'.$langs->trans("Disabled").'</th>';
|
//print '<th class="center">'.$langs->trans("Disabled").'</th>';
|
||||||
print '<th>'.$form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")).'</th>';
|
print '<th>'.$form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")).'</th>';
|
||||||
print '<th>'.$langs->trans("Comment").'</th>';
|
print '<th>'.$langs->trans("Comment").'</th>';
|
||||||
print '<th></th>';
|
print '<th class="thstickyright tdstickyghostwhite"></th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobjet->fields may have been
|
// We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobjet->fields may have been
|
||||||
@ -2736,7 +2763,7 @@ if ($module == 'initmodule') {
|
|||||||
if (!empty($properties)) {
|
if (!empty($properties)) {
|
||||||
// Line to add a property
|
// Line to add a property
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="propname" value="'.dol_escape_htmltag(GETPOST('propname', 'alpha')).'"></td>';
|
print '<td class="tdsticky tdstickygray"><input type="text" class="maxwidth75" name="propname" value="'.dol_escape_htmltag(GETPOST('propname', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel', 'alpha')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype', 'alpha')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval', 'restricthtml')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval', 'restricthtml')).'"></td>';
|
||||||
@ -2758,7 +2785,7 @@ if ($module == 'initmodule') {
|
|||||||
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
|
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
|
||||||
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth100" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
|
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth100" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
|
||||||
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
|
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -2803,7 +2830,7 @@ if ($module == 'initmodule') {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td>';
|
print '<td class="tdsticky tdstickygray">';
|
||||||
print dol_escape_htmltag($propname);
|
print dol_escape_htmltag($propname);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -2818,7 +2845,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
print '<input name="proparrayofkeyval" value="';
|
print '<input name="proparrayofkeyval" value="';
|
||||||
if (isset($proparrayofkeyval)) {
|
if (isset($proparrayofkeyval)) {
|
||||||
print dol_escape_htmltag(json_encode($proparrayofkeyval));
|
print dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE));
|
||||||
}
|
}
|
||||||
print '">';
|
print '">';
|
||||||
print '</input>';
|
print '</input>';
|
||||||
@ -2874,7 +2901,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input class="maxwidth100" name="propcomment" value="'.dol_escape_htmltag($propcomment).'">';
|
print '<input class="maxwidth100" name="propcomment" value="'.dol_escape_htmltag($propcomment).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
print '<input class="button smallpaddingimp" type="submit" name="edit" value="'.$langs->trans("Save").'">';
|
print '<input class="button smallpaddingimp" type="submit" name="edit" value="'.$langs->trans("Save").'">';
|
||||||
print '<input class="button button-cancel smallpaddingimp" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel smallpaddingimp" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2884,8 +2911,8 @@ if ($module == 'initmodule') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
if ($proparrayofkeyval) {
|
if ($proparrayofkeyval) {
|
||||||
print '<span title="'.dol_escape_htmltag(json_encode($proparrayofkeyval)).'">';
|
print '<span title="'.dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE)).'">';
|
||||||
print dol_escape_htmltag(json_encode($proparrayofkeyval));
|
print dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE));
|
||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2945,7 +2972,7 @@ if ($module == 'initmodule') {
|
|||||||
print dol_escape_htmltag($propcomment);
|
print dol_escape_htmltag($propcomment);
|
||||||
print '</span>';
|
print '</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
if ($propname != 'rowid') {
|
if ($propname != 'rowid') {
|
||||||
print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
|
print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
|
||||||
print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||||
@ -3079,14 +3106,14 @@ if ($module == 'initmodule') {
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("fk_menu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("RelativeURL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
@ -3124,15 +3151,15 @@ if ($module == 'initmodule') {
|
|||||||
print dol_escape_htmltag($menu['langs']);
|
print dol_escape_htmltag($menu['langs']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
print dol_escape_htmltag($menu['position']);
|
print dol_escape_htmltag($menu['position']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
print '<td class="center tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
||||||
print dol_escape_htmltag($menu['enabled']);
|
print dol_escape_htmltag($menu['enabled']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
print '<td class="center tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
||||||
print dol_escape_htmltag($menu['perms']);
|
print dol_escape_htmltag($menu['perms']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -3834,8 +3861,10 @@ if ($module == 'initmodule') {
|
|||||||
$FILENAMEDOCPDF = $modulelowercase.'.pdf';
|
$FILENAMEDOCPDF = $modulelowercase.'.pdf';
|
||||||
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
||||||
$outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC;
|
$outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC;
|
||||||
|
$outputfiledocrel = $modulelowercase.'/doc/'.$FILENAMEDOC;
|
||||||
$outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF;
|
$outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF;
|
||||||
$outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF;
|
$outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF;
|
||||||
|
$outputfiledocrelpdf = $modulelowercase.'/doc/'.$FILENAMEDOCPDF;
|
||||||
|
|
||||||
// HTML
|
// HTML
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
||||||
@ -3848,6 +3877,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</strong>';
|
print '</strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocrel).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
@ -3862,6 +3892,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</strong>';
|
print '</strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocpdfrel).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
@ -3928,8 +3959,11 @@ if ($module == 'initmodule') {
|
|||||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||||
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($relativepath).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -108,11 +108,11 @@ class MyObject extends CommonObject
|
|||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1),
|
||||||
'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1),
|
'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1),
|
||||||
'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1),
|
'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1),
|
||||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1),
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1),
|
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1),
|
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1),
|
||||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1),
|
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'),
|
||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501),
|
||||||
//'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
//'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||||
@ -122,7 +122,7 @@ class MyObject extends CommonObject
|
|||||||
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600),
|
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010),
|
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010),
|
||||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled'), 'validate'=>1),
|
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled'), 'validate'=>1),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -305,7 +305,7 @@ class modMyModule extends DolibarrModules
|
|||||||
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
|
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
|
||||||
$this->menu[$r++]=array(
|
$this->menu[$r++]=array(
|
||||||
'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||||
'type'=>'left', // This is a Top menu entry
|
'type'=>'left', // This is a Left menu entry
|
||||||
'titre'=>'MyObject',
|
'titre'=>'MyObject',
|
||||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
||||||
'mainmenu'=>'mymodule',
|
'mainmenu'=>'mymodule',
|
||||||
@ -432,7 +432,7 @@ class modMyModule extends DolibarrModules
|
|||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
// Document templates
|
// Document templates
|
||||||
$moduledir = 'mymodule';
|
$moduledir = dol_sanitizeFileName('mymodule');
|
||||||
$myTmpObjects = array();
|
$myTmpObjects = array();
|
||||||
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||||
|
|
||||||
@ -441,8 +441,8 @@ class modMyModule extends DolibarrModules
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($myTmpObjectArray['includerefgeneration']) {
|
if ($myTmpObjectArray['includerefgeneration']) {
|
||||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt';
|
||||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
|
||||||
$dest = $dirodt.'/template_myobjects.odt';
|
$dest = $dirodt.'/template_myobjects.odt';
|
||||||
|
|
||||||
if (file_exists($src) && !file_exists($dest)) {
|
if (file_exists($src) && !file_exists($dest)) {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user