Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
f9a99f506f
@ -97,7 +97,7 @@ if (empty($reshook))
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_account = "";
|
||||
$search_label = "";
|
||||
|
||||
@ -98,7 +98,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref = '';
|
||||
$search_label = '';
|
||||
|
||||
@ -98,7 +98,7 @@ if (! empty($search_accountancy_code_end)) {
|
||||
* Action
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
|
||||
@ -72,15 +72,24 @@ if ($action == "confirm_update") {
|
||||
$error = 0;
|
||||
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action='update';
|
||||
}
|
||||
if (empty($account_number) || $account_number == '-1')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||
$action='update';
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
if (! $error)
|
||||
{
|
||||
$book = new BookKeeping($db);
|
||||
|
||||
$result = $book->fetch($id, null, $mode);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($book->error, $book->errors, 'errors');
|
||||
} else {
|
||||
$book->numero_compte = $account_number;
|
||||
@ -120,12 +129,20 @@ if ($action == "confirm_update") {
|
||||
else if ($action == "add") {
|
||||
$error = 0;
|
||||
|
||||
if (empty($debit) && empty($credit)) {
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$error ++;
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action='';
|
||||
}
|
||||
if (empty($account_number) || $account_number == '-1')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
if (! $error) {
|
||||
$book = new BookKeeping($db);
|
||||
|
||||
$book->numero_compte = $account_number;
|
||||
@ -567,7 +584,7 @@ if ($action == 'create') {
|
||||
|
||||
if ($action == 'update' && $line->id == $id) {
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($line->numero_compte, 'account_number', 1, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
|
||||
@ -583,8 +600,8 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . price($line->credit) . '"/></td>';
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="id" value="' . $line->id . '">' . "\n";
|
||||
print '<input type="submit" class="button" name="update" value="' . $langs->trans("Update") . '">';
|
||||
@ -622,7 +639,7 @@ if ($action == 'create') {
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($account_number, 'account_number', 1, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
|
||||
@ -638,24 +655,30 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
||||
print '<td><input type="text" size="15" name="label_operation" value="' . $line->label_operation. '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="debit" value="' . ($debit ? price($debit) : '') . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="credit" value="' . ($credit ? price($credit) : '') . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . ($debit ? price($debit) : '') . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . ($credit ? price($credit) : '') . '"/></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
if ($mode=='_tmp' && $action=='')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
if ($total_debit == $total_credit)
|
||||
{
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '&action=valid">'.$langs->trans("ValidTransaction").'</a>';
|
||||
print '<a class="button" href="' . $_SERVER["PHP_SELF"] . '?piece_num=' . $book->piece_num . '&action=valid">'.$langs->trans("ValidTransaction").'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $credit, $debit)).'">'.$langs->trans("ValidTransaction").'</a>';
|
||||
print '<input type="submit" class="button" disabled="disabled" href="#" title="'.dol_escape_htmltag($langs->trans("MvtNotCorrectlyBalanced", $credit, $debit)).'" value="'.dol_escape_htmltag($langs->trans("ValidTransaction")).'">';
|
||||
}
|
||||
|
||||
print ' ';
|
||||
print '<a class="button" href="' . DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">'.$langs->trans("Cancel").'</a>';
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
print '</form>';
|
||||
|
||||
@ -112,7 +112,7 @@ if ($action != 'export_file' && ! isset($_POST['begin']) && ! isset($_GET['begin
|
||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_mvt_num = '';
|
||||
$search_doc_type = '';
|
||||
|
||||
@ -92,7 +92,7 @@ if (! empty($search_doc_date)) {
|
||||
}
|
||||
|
||||
|
||||
if (!GETPOST("button_removefilter_x") && !GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (!GETPOST('button_removefilter_x','alpha') && !GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
if (! empty($search_accountancy_code_start)) {
|
||||
$filter['t.numero_compte'] = $search_accountancy_code_start;
|
||||
@ -121,7 +121,7 @@ if (!GETPOST("button_removefilter_x") && !GETPOST("button_removefilter")) // Bot
|
||||
* Action
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_doc_date = '';
|
||||
$search_accountancy_code = '';
|
||||
|
||||
@ -86,7 +86,7 @@ $offset = $limit * $page;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_doc_type = "";
|
||||
$search_doc_date = "";
|
||||
|
||||
@ -85,7 +85,7 @@ $formaccounting = new FormAccounting($db);
|
||||
*/
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
@ -153,7 +153,7 @@ print '<script type="text/javascript">
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql .= " fd.situation_percent, co.label as country, s.tva_intra";
|
||||
@ -270,9 +270,9 @@ if ($result) {
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
@ -287,9 +287,9 @@ if ($result) {
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "fd.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "fd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "fd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
$clickpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
|
||||
@ -332,14 +332,14 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||
print '<td>';
|
||||
print '<td align="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
print '<td align="center">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
print '<td align="center">' . $objp->country .'</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
@ -179,7 +179,7 @@ llxHeader('', $langs->trans("Ventilation"));
|
||||
|
||||
// Customer Invoice lines
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " aa.rowid as aarowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
@ -388,7 +388,7 @@ if ($result) {
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p)
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
print '<td style="' . $code_vat_differ . '" align="right">';
|
||||
print price($objp->tva_tx_line);
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
// Current account
|
||||
|
||||
@ -82,7 +82,7 @@ $formaccounting = new FormAccounting($db);
|
||||
*/
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_expensereport = '';
|
||||
$search_label = '';
|
||||
@ -146,7 +146,7 @@ print '<script type="text/javascript">
|
||||
* Expense reports lines
|
||||
*/
|
||||
$sql = "SELECT er.ref, er.rowid as erid,";
|
||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.date,";
|
||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
|
||||
$sql .= " aa.label, aa.account_number,";
|
||||
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
@ -241,8 +241,8 @@ if ($result) {
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" size="1" placeholder="%" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" placeholder="%" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
@ -258,7 +258,7 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
@ -293,7 +293,7 @@ if ($result) {
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
|
||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||
print '<td align="center">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $codeCompta . '</td>';
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_expensereport = '';
|
||||
$search_label = '';
|
||||
@ -174,7 +174,7 @@ llxHeader('', $langs->trans("ExpenseReportsVentilation"));
|
||||
|
||||
// Expense report lines
|
||||
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut,";
|
||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.date,";
|
||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
|
||||
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
||||
$sql .= " aa.rowid as aarowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
@ -284,8 +284,8 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "erd.comments", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "erd.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"', $sortfield, $sortorder);
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
@ -333,7 +333,7 @@ if ($result) {
|
||||
|
||||
// Vat rate
|
||||
print '<td align="right">';
|
||||
print price($objp->tva_tx_line);
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
// Current account
|
||||
|
||||
@ -175,9 +175,9 @@ if ($result) {
|
||||
|
||||
// Set accountancy code (for bank and thirdparty)
|
||||
$compta_bank = $obj->account_number;
|
||||
if ($obj->label == '(SupplierInvoicePayment)')
|
||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)')
|
||||
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
|
||||
if ($obj->label == '(CustomerInvoicePayment)')
|
||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)')
|
||||
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
||||
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
@ -625,10 +625,10 @@ if ($action == 'exportcsv') {
|
||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||
|
||||
$reflabel = $val["ref"];
|
||||
if ($reflabel == '(SupplierInvoicePayment)') {
|
||||
if ($reflabel == '(SupplierInvoicePayment)' || $reflabel == '(SupplierInvoicePaymentBack)') {
|
||||
$reflabel = $langs->trans('Supplier');
|
||||
}
|
||||
if ($reflabel == '(CustomerInvoicePayment)') {
|
||||
if ($reflabel == '(CustomerInvoicePayment)' || $reflabel == '(CustomerInvoicePaymentBack)') {
|
||||
$reflabel = $langs->trans('Customer');
|
||||
}
|
||||
if ($reflabel == '(SocialContributionPayment)') {
|
||||
@ -796,10 +796,10 @@ if (empty($action) || $action == 'view') {
|
||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||
|
||||
$reflabel = $val["ref"];
|
||||
if ($reflabel == '(SupplierInvoicePayment)') {
|
||||
if ($reflabel == '(SupplierInvoicePayment)' || $reflabel == '(SupplierInvoicePaymentBack)') {
|
||||
$reflabel = $langs->trans('Supplier');
|
||||
}
|
||||
if ($reflabel == '(CustomerInvoicePayment)') {
|
||||
if ($reflabel == '(CustomerInvoicePayment)' || $reflabel == '(CustomerInvoicePaymentBack)') {
|
||||
$reflabel = $langs->trans('Customer');
|
||||
}
|
||||
if ($reflabel == '(SocialContributionPayment)') {
|
||||
@ -913,7 +913,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$variousstatic->fetch($objmid->id);
|
||||
$ref=$variousstatic->getNomUrl(1);
|
||||
$ref=$langs->trans("VariousPayment").' '.$variousstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ $formaccounting = new FormAccounting($db);
|
||||
*/
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
@ -154,7 +154,8 @@ print '<script type="text/javascript">
|
||||
* Supplier Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.ref as facnumber, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, aa.label, aa.account_number, ";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql.= " aa.label, aa.account_number, ";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
@ -266,8 +267,8 @@ if ($result) {
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
@ -285,10 +286,10 @@ if ($result) {
|
||||
//print_liste_field_titre($langs->trans("ProductLabel"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
@ -336,7 +337,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||
print '<td align="center">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
print '<td align="left">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
|
||||
@ -100,7 +100,7 @@ if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
@ -181,7 +181,7 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||
|
||||
// Supplier Invoice Lines
|
||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
@ -394,7 +394,7 @@ if ($result) {
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p)
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
print '<td style="' . $code_vat_differ . '" align="right">';
|
||||
print price($objp->tva_tx_line);
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
// Current account
|
||||
|
||||
@ -151,7 +151,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search="";
|
||||
$search_ref="";
|
||||
|
||||
@ -88,7 +88,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search="";
|
||||
$search_ref="";
|
||||
|
||||
@ -69,7 +69,7 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('adherent_type');
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_lastname="";
|
||||
$search_login="";
|
||||
|
||||
@ -79,7 +79,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$defaulturl='';
|
||||
$defaultkey='';
|
||||
|
||||
@ -180,7 +180,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
if (empty($reshook))
|
||||
{
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_label='';
|
||||
$toselect='';
|
||||
|
||||
@ -178,7 +178,7 @@ print '<td align="center" width="100">'.$langs->trans("Value").'</td>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_useRateOnDocumentDate").'</td>';
|
||||
print '<td>'.$langs->transnoentitiesnoconv("MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
print '<td align="right" width="400">';
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
|
||||
@ -116,7 +116,7 @@ print load_fiche_titre($langs->trans("Backup"),'','title_setup');
|
||||
print '<div class="center">';
|
||||
print $langs->trans("BackupDesc",DOL_DATA_ROOT);
|
||||
print '</div>';
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans("Restore"),'','title_setup');
|
||||
print '<div class="center">';
|
||||
print $langs->trans("RestoreDesc",DOL_DATA_ROOT);
|
||||
print '</div>';
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
?>
|
||||
<fieldset>
|
||||
@ -156,7 +156,7 @@ if (in_array($type, array('mysql', 'mysqli')))
|
||||
print '<br>';
|
||||
print '<textarea rows="1" id="restorecommand" class="centpercent">'.$langs->trans("ImportMySqlCommand",$command,($showpass?$paramclear:$paramcrypted)).'</textarea><br>';
|
||||
print ajax_autoselect('restorecommand');
|
||||
|
||||
|
||||
if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&radio_dump=mysql_options">'.$langs->trans("UnHidePassword").'</a>';
|
||||
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
|
||||
?>
|
||||
|
||||
@ -100,7 +100,7 @@ $date_endyear = $tmp['year'];
|
||||
$now=dol_now();
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$date_start=-1;
|
||||
$date_end=-1;
|
||||
|
||||
@ -31,7 +31,7 @@ if (! $user->admin)
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$choice=GETPOST('choice');
|
||||
$choice=GETPOST('choice','aZ09');
|
||||
|
||||
|
||||
// Define filelog to discard it from purge
|
||||
|
||||
@ -74,7 +74,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$transkey='';
|
||||
$transvalue='';
|
||||
|
||||
@ -77,11 +77,11 @@ $workflowcodes=array(
|
||||
'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array('family'=>'create', 'position'=>10, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
||||
'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array('family'=>'create', 'position'=>20, 'enabled'=>'! empty($conf->commande->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'bill'),
|
||||
// Automatic classification
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>'WarningCloseAlways'),
|
||||
'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order','warning'=>''),
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->propal->enabled) && ! empty($conf->facture->enabled)', 'picto'=>'order','warning'=>''),
|
||||
// For the following 2 options, if module invoice is disabled, they does not exists, so "Classify billed" for order must be done manually from order card.
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>'WarningCloseAlways'),
|
||||
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>50, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>''),
|
||||
'WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER'=>array('family'=>'classify', 'position'=>40, 'enabled'=>'! empty($conf->facture->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'bill','warning'=>''),
|
||||
'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array('family'=>'classify', 'position'=>30, 'enabled'=>'! empty($conf->expedition->enabled) && ! empty($conf->commande->enabled)', 'picto'=>'order'),
|
||||
);
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
|
||||
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$attrname=GETPOST('attrname', 'alpha');
|
||||
$elementtype='categories'; //Must be the $element of the class that manage extrafield
|
||||
$elementtype='categorie'; //Must be the $element of the class that manage extrafield
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ class Categorie extends CommonObject
|
||||
const TYPE_USER = 4; // categorie contact and user are same ! TODO Replace this value with 'user'
|
||||
|
||||
const TYPE_ACCOUNT = 5; // TODO Replace this value with 'bank_account'
|
||||
const TYPE_PROJECT = 6;
|
||||
const TYPE_PROJECT = 6; // TODO Replace this value with 'project'
|
||||
const TYPE_BANK_LINE = 'bank_line';
|
||||
public $picto = 'category';
|
||||
|
||||
|
||||
@ -543,8 +543,10 @@ $resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$MAXONSAMEPAGE=10000; // Useless to have more. Protection to avoid memory overload when high number of event (for example after a mass import)
|
||||
$i=0;
|
||||
while ($i < $num)
|
||||
while ($i < $num && $i < $MAXONSAMEPAGE)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_title='';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
@ -534,74 +534,73 @@ if ($id > 0)
|
||||
$boxstat.='<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom" width="100%">';
|
||||
$boxstat.='<tr class="impair"><td colspan="2" class="tdboxstats nohover">';
|
||||
|
||||
if ($conf->propal->enabled)
|
||||
if (! empty($conf->propal->enabled))
|
||||
{
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingProposals();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$text=$langs->trans("OverAllProposals");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingProposals();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$text=$langs->trans("OverAllProposals");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
if ($conf->commande->enabled)
|
||||
if (! empty($conf->commande->enabled))
|
||||
{
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingOrders();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$text=$langs->trans("OverAllOrders");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
// Box proposals
|
||||
$tmp = $object->getOutstandingOrders();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$text=$langs->trans("OverAllOrders");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
if ($conf->facture->enabled)
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$tmp = $object->getOutstandingBills();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$tmp = $object->getOutstandingBills();
|
||||
$outstandingOpened=$tmp['opened'];
|
||||
$outstandingTotal=$tmp['total_ht'];
|
||||
$outstandingTotalIncTax=$tmp['total_ttc'];
|
||||
$text=$langs->trans("OverAllInvoices");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
|
||||
$text=$langs->trans("OverAllInvoices");
|
||||
$link='';
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator">'.price($outstandingTotal, 1, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
|
||||
// Box outstanding bill
|
||||
$warn = '';
|
||||
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened)
|
||||
{
|
||||
$warn = ' '.img_warning($langs->trans("OutstandingBillReached"));
|
||||
}
|
||||
$text=$langs->trans("CurrentOutstandingBill");
|
||||
$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
// Box outstanding bill
|
||||
$warn = '';
|
||||
if ($object->outstanding_limit != '' && $object->outstanding_limit < $outstandingOpened)
|
||||
{
|
||||
$warn = ' '.img_warning($langs->trans("OutstandingBillReached"));
|
||||
}
|
||||
$text=$langs->trans("CurrentOutstandingBill");
|
||||
$link=DOL_URL_ROOT.'/compta/recap-compta.php?socid='.$object->id;
|
||||
$icon='bill';
|
||||
if ($link) $boxstat.='<a href="'.$link.'" class="boxstatsindicator thumbstat nobold nounderline">';
|
||||
$boxstat.='<div class="boxstats">';
|
||||
$boxstat.='<span class="boxstatstext">'.img_object("",$icon).' '.$text.'</span><br>';
|
||||
$boxstat.='<span class="boxstatsindicator'.($outstandingOpened>0?' amountremaintopay':'').'">'.price($outstandingOpened, 1, $langs, 1, -1, -1, $conf->currency).$warn.'</span>';
|
||||
$boxstat.='</div>';
|
||||
if ($link) $boxstat.='</a>';
|
||||
}
|
||||
|
||||
$boxstat.='</td></tr>';
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
* \brief Page to define emailing targets
|
||||
*/
|
||||
|
||||
if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1');
|
||||
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/comm/mailing/class/mailing.class.php';
|
||||
@ -66,7 +68,7 @@ $search_email = GETPOST("search_email");
|
||||
$template_id = GETPOST('template_id', 'int');
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x")) {
|
||||
if (GETPOST('button_removefilter_x','alpha')) {
|
||||
$search_nom = '';
|
||||
$search_prenom = '';
|
||||
$search_email = '';
|
||||
@ -404,14 +406,8 @@ if ($_POST["button_removefilter"]) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$extrajs = array (
|
||||
'/includes/jquery/plugins/multiselect/js/ui.multiselect.js'
|
||||
);
|
||||
$extracss = array (
|
||||
'/includes/jquery/plugins/multiselect/css/ui.multiselect.css',
|
||||
);
|
||||
|
||||
llxHeader('', $langs->trans("MailAdvTargetRecipients"), '', '', '', '', $extrajs, $extracss);
|
||||
llxHeader('', $langs->trans("MailAdvTargetRecipients"));
|
||||
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
@ -474,7 +474,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as saleman ON saleman.fk_soc=t.rowid ";
|
||||
}
|
||||
if (array_key_exists('cust_categ', $arrayquery)) {
|
||||
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "categorie_societe as custcateg ON custcateg.fk_societe=t.rowid ";
|
||||
$sql.= " LEFT OUTER JOIN " . MAIN_DB_PREFIX . "categorie_societe as custcateg ON custcateg.fk_soc=t.rowid ";
|
||||
}
|
||||
|
||||
if (!empty($arrayquery['cust_name'])) {
|
||||
|
||||
@ -89,7 +89,7 @@ class FormAdvTargetEmailing extends Form
|
||||
|
||||
$langs->load("dict");
|
||||
$maxlength = 0;
|
||||
|
||||
|
||||
$out = '';
|
||||
$countryArray = array();
|
||||
$label = array ();
|
||||
@ -252,7 +252,7 @@ class FormAdvTargetEmailing extends Form
|
||||
// $sql.= ' WHERE entity = '.$conf->entity;
|
||||
|
||||
$options_array = array();
|
||||
|
||||
|
||||
dol_syslog(get_class($this) . "::".__METHOD__,LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
@ -335,49 +335,8 @@ class FormAdvTargetEmailing extends Form
|
||||
function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) {
|
||||
global $conf, $langs;
|
||||
|
||||
$return = '';
|
||||
$return .= '<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
$.extend($.ui.multiselect.locale, {
|
||||
addAll:\'' . $langs->transnoentities ( "AddAll" ) . '\',
|
||||
removeAll:\'' . $langs->transnoentities ( "RemoveAll" ) . '\',
|
||||
itemsCount:\'' . $langs->transnoentities ( "ItemsCount" ) . '\'
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$("#' . $htmlname . '").addClass("' . $htmlname . '").attr("multiple","multiple").attr("name","' . $htmlname . '[]");
|
||||
$(".multiselect").multiselect({sortable: false, searchable: false});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
$return .= '<select id="' . $htmlname . '" class="multiselect" multiple="multiple" name="' . $htmlname . '[]" style="display: none;">';
|
||||
//$return .= '<select id="' . $htmlname . '" class="multiselect" multiple="multiple" name="' . $htmlname . '[]">';
|
||||
|
||||
if ($showempty)
|
||||
$return .= '<option value=""> </option>';
|
||||
|
||||
// Find if keys is in selected array value
|
||||
if (is_array($selected_array) && count($selected_array)>0) {
|
||||
$intersect_array = array_intersect_key($options_array, array_flip($selected_array));
|
||||
} else {
|
||||
$intersect_array=array();
|
||||
}
|
||||
|
||||
if (count($options_array) > 0) {
|
||||
foreach ($options_array as $keyoption => $valoption) {
|
||||
// If key is in intersect table then it have to e selected
|
||||
$selected = '';
|
||||
if (count ( $intersect_array ) > 0) {
|
||||
if (array_key_exists ( $keyoption, $intersect_array )) {
|
||||
$selected = ' selected="selected"';
|
||||
}
|
||||
}
|
||||
$return .= '<option' . $selected . ' value="' . $keyoption . '">' . $valoption . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
$return .= '</select>';
|
||||
|
||||
$form=new Form($this->db);
|
||||
$return = $form->multiselectarray($htmlname, $options_array, $selected_array,0,0,'',0,295);
|
||||
return $return;
|
||||
}
|
||||
|
||||
@ -448,7 +407,7 @@ class FormAdvTargetEmailing extends Form
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
return $this->advMultiselectarray ( $htmlname, $options_array, $selected_array );
|
||||
return $this->advMultiselectarray( $htmlname, $options_array, $selected_array );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1250,6 +1250,8 @@ $now = dol_now();
|
||||
// Add new proposal
|
||||
if ($action == 'create')
|
||||
{
|
||||
$currency_code = $conf->currency;
|
||||
|
||||
print load_fiche_titre($langs->trans("NewProp"));
|
||||
|
||||
$soc = new Societe($db);
|
||||
|
||||
@ -2362,7 +2362,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'propal SET fk_statut = '.self::STATUS_BILLED;
|
||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT.' ;';
|
||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -3502,7 +3502,7 @@ class Propal extends CommonObject
|
||||
/**
|
||||
* Class to manage commercial proposal lines
|
||||
*/
|
||||
class PropaleLigne extends CommonObjectLine
|
||||
class PropaleLigne extends CommonObjectLine
|
||||
{
|
||||
public $element='propaldet';
|
||||
public $table_element='propaldet';
|
||||
|
||||
@ -178,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
|
||||
@ -65,9 +65,8 @@ class Commande extends CommonOrder
|
||||
public $contactid;
|
||||
|
||||
/**
|
||||
* Status of the order. Check the following constants:
|
||||
* Status of the order
|
||||
* @var int
|
||||
* @see Commande::STATUS_CANCELED, Commande::STATUS_DRAFT, Commande::STATUS_ACCEPTED, Commande::STATUS_CLOSED
|
||||
*/
|
||||
public $statut;
|
||||
/**
|
||||
|
||||
@ -162,7 +162,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_categ='';
|
||||
$search_user='';
|
||||
@ -191,6 +191,11 @@ if (empty($reshook))
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')
|
||||
|| GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha'))
|
||||
{
|
||||
$massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Commande';
|
||||
@ -371,7 +376,7 @@ if (empty($reshook))
|
||||
|
||||
}
|
||||
|
||||
$cmd->classifyBilled($user);
|
||||
//$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module.
|
||||
|
||||
if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object;
|
||||
else $TFact[$object->id] = $object;
|
||||
@ -754,7 +759,7 @@ if ($resql)
|
||||
//var_dump($_REQUEST);
|
||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||
|
||||
print '<table class="border" width="100%" >';
|
||||
print '<table class="noborder" width="100%" >';
|
||||
print '<tr>';
|
||||
print '<td class="titlefieldmiddle">';
|
||||
print $langs->trans('DateInvoice');
|
||||
@ -776,7 +781,15 @@ if ($resql)
|
||||
print $langs->trans('ValidateInvoices');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->selectyesno('valdate_invoices', 1, 1);
|
||||
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
|
||||
{
|
||||
print $form->selectyesno('valdate_invoices', 0, 1, 1);
|
||||
print ' ('.$langs->trans("AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation").')';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->selectyesno('valdate_invoices', 0, 1);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
@ -838,7 +851,7 @@ if ($resql)
|
||||
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
@ -976,6 +989,7 @@ if ($resql)
|
||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||
Commande::STATUS_ACCEPTED=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('viewstatut', $liststatus, $viewstatut, -4);
|
||||
@ -1033,7 +1047,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'],$_SERVER["PHP_SELF"],"c.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'],$_SERVER["PHP_SELF"],'c.facture','',$param,'align="center"',$sortfield,$sortorder,'');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'',$param,'align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print '</tr>'."\n";
|
||||
|
||||
$total=0;
|
||||
|
||||
@ -178,7 +178,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_dt_start='';
|
||||
$search_dt_end='';
|
||||
|
||||
@ -121,7 +121,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$statut = 'all';
|
||||
$search_ref='';
|
||||
|
||||
@ -69,7 +69,7 @@ else
|
||||
$typeid=$_REQUEST['typeid'];
|
||||
}
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
|
||||
@ -57,7 +57,7 @@ if (! $sortfield) $sortfield="d.dated";
|
||||
$year=GETPOST("year");
|
||||
$month=GETPOST("month");
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_name="";
|
||||
|
||||
@ -4185,7 +4185,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if (! $objectidnext && count($object->lines) > 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid=' . $object->id . '&action=create">' . $langs->trans("ChangeIntoRepeatableInvoice") . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,13 +46,18 @@ $langs->load('compta');
|
||||
$langs->load('admin');
|
||||
$langs->load('other');
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$massaction = GETPOST('massaction','alpha');
|
||||
$show_files = GETPOST('show_files','int');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'invoicetemplatelist'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$lineid=GETPOST('lineid','int');
|
||||
$ref=GETPOST('ref','alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$objecttype = 'facture_rec';
|
||||
if ($action == "create" || $action == "add") $objecttype = '';
|
||||
@ -112,7 +117,7 @@ $arrayfields=array(
|
||||
'f.tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
|
||||
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
|
||||
'f.frequency'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1),
|
||||
'f.nb_gen_done'=>array('label'=>$langs->trans("NbGeneration"), 'checked'=>1),
|
||||
'f.nb_gen_done'=>array('label'=>$langs->trans("NbOfGenerationDone"), 'checked'=>1),
|
||||
'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1),
|
||||
'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1),
|
||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
@ -132,6 +137,9 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||
|
||||
$parameters = array('socid' => $socid);
|
||||
$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');
|
||||
@ -140,6 +148,9 @@ if (empty($reshook))
|
||||
{
|
||||
if (GETPOST('cancel')) $action='';
|
||||
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Set note
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
@ -148,7 +159,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref='';
|
||||
$search_societe='';
|
||||
@ -165,6 +176,14 @@ if (empty($reshook))
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
/*$objectclass='MyObject';
|
||||
$objectlabel='MyObject';
|
||||
$permtoread = $user->rights->mymodule->read;
|
||||
$permtodelete = $user->rights->mymodule->delete;
|
||||
$uploaddir = $conf->mymodule->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/
|
||||
|
||||
// Create predefined invoice
|
||||
if ($action == 'add')
|
||||
{
|
||||
@ -517,7 +536,7 @@ if (empty($reshook))
|
||||
|
||||
$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
|
||||
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
|
||||
|
||||
|
||||
// if price ht was forced (ie: from gui when calculated by margin rate and cost price). TODO Why this ?
|
||||
if (! empty($price_ht))
|
||||
{
|
||||
@ -905,7 +924,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="facid" value="'.$object->id.'">';
|
||||
|
||||
dol_fiche_head();
|
||||
dol_fiche_head(null, '', '', 0);
|
||||
|
||||
$rowspan=4;
|
||||
if (! empty($conf->projet->enabled)) $rowspan++;
|
||||
@ -942,7 +961,7 @@ if ($action == 'create')
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')'
|
||||
);
|
||||
$substitutionarray['__(TransKey)__']=$langs->trans("TransKey");
|
||||
|
||||
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($substitutionarray as $key => $val)
|
||||
{
|
||||
@ -952,10 +971,10 @@ if ($action == 'create')
|
||||
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print '<td class="tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
print '<td colspan="2">';
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
||||
@ -963,7 +982,7 @@ if ($action == 'create')
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print '<td class="tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
@ -1007,12 +1026,14 @@ if ($action == 'create')
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br><br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Autogeneration
|
||||
$title = $langs->trans("Recurrence");
|
||||
print load_fiche_titre($title, '', 'calendar');
|
||||
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$title, '', '');
|
||||
|
||||
dol_fiche_head(null, '', '', 0);
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
@ -1040,7 +1061,8 @@ if ($action == 'create')
|
||||
|
||||
print "</table>";
|
||||
|
||||
print '<br><br>';
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
$title = $langs->trans("ProductsAndServices");
|
||||
if (empty($conf->service->enabled))
|
||||
@ -1078,8 +1100,6 @@ if ($action == 'create')
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||
print ' ';
|
||||
print '<input type="button" class="button" value="' . $langs->trans("Cancel") . '" onClick="javascript:history.go(-1)">';
|
||||
@ -1260,7 +1280,7 @@ else
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')'
|
||||
);
|
||||
$substitutionarray['__(TransKey)__']=$langs->trans("TransKey");
|
||||
|
||||
|
||||
$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
|
||||
foreach($substitutionarray as $key => $val)
|
||||
{
|
||||
@ -1323,7 +1343,7 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td colspan="2"><span class="fa fa-calendar"></span> '.$title.'</td></tr>';
|
||||
|
||||
|
||||
// if "frequency" is empty or = 0, the reccurence is disabled
|
||||
print '<tr><td style="width: 50%">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
@ -1558,7 +1578,8 @@ else
|
||||
* List mode
|
||||
*/
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency,";
|
||||
$sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when";
|
||||
$sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when,";
|
||||
$sql.= " f.datec, f.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -1570,10 +1591,10 @@ else
|
||||
}
|
||||
if ($search_ref) $sql .= natural_search('f.titre', $search_ref);
|
||||
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
|
||||
if ($search_frequency) $sql .= natural_search('f.frequency', $search_frequency);
|
||||
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
|
||||
if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1);
|
||||
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
|
||||
if ($search_frequency > 0) $sql.= natural_search('f.frequency', $search_frequency);
|
||||
if ($search_frequency == '1') $sql.= ' AND f.frequency > 0';
|
||||
if ($search_frequency == '0') $sql.= ' AND (f.frequency IS NULL or f.frequency = 0)';
|
||||
|
||||
@ -1605,23 +1626,24 @@ else
|
||||
}
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if ($socid) $param.='&socid='.$socid;
|
||||
if ($day) $param.='&day='.$day;
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year=' .$year;
|
||||
@ -1631,9 +1653,9 @@ else
|
||||
if ($search_ref) $param.='&search_ref=' .$search_ref;
|
||||
if ($search_societe) $param.='&search_societe=' .$search_societe;
|
||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
|
||||
if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat;
|
||||
if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat;
|
||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
|
||||
if ($search_frequency) $param.='&search_frequency=' .$search_frequency;
|
||||
if ($search_frequency > 0) $param.='&search_frequency=' .$search_frequency;
|
||||
if ($option) $param.="&option=".$option;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
// Add $param from extra fields
|
||||
@ -1646,14 +1668,20 @@ else
|
||||
|
||||
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
|
||||
|
||||
print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
//$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
print '<form method="POST" id="searchFormList" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
|
||||
print_barre_liste($langs->trans("RepeatableInvoices"),$page,$_SERVER['PHP_SELF'],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_accountancy.png',0,'','',$limit);
|
||||
|
||||
@ -1776,23 +1804,23 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER['PHP_SELF'],"f.total","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountVAT"),$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("NbOfGenerationDone"),$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre(''); // Field may contains ling text
|
||||
if (! empty($arrayfields['f.titre']['checked'])) print_liste_field_titre($arrayfields['f.titre']['label'],$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],"s.nom","",$param,"",$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.total']['checked'])) print_liste_field_titre($arrayfields['f.total']['label'],$_SERVER['PHP_SELF'],"f.total","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.tva']['checked'])) print_liste_field_titre($arrayfields['f.tva']['label'],$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.frequency']['checked'])) print_liste_field_titre($arrayfields['f.frequency']['label'],$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked'])) print_liste_field_titre($arrayfields['f.nb_gen_done']['label'],$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.date_last_gen']['checked'])) print_liste_field_titre($arrayfields['f.date_last_gen']['label'],$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.date_when']['checked'])) print_liste_field_titre($arrayfields['f.date_when']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=true;
|
||||
@ -1800,26 +1828,67 @@ else
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
|
||||
print "</a></td>\n";
|
||||
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->name=$objp->name;
|
||||
print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
|
||||
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
||||
print '<td align="right">'.price($objp->total_vat).'</td>'."\n";
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (! empty($arrayfields['f.titre']['checked']))
|
||||
{
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
|
||||
print "</a></td>\n";
|
||||
}
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
||||
}
|
||||
if (! empty($arrayfields['f.tva']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($objp->total_vat).'</td>'."\n";
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
print '<td align="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||
}
|
||||
if (! empty($arrayfields['f.frequency']['checked']))
|
||||
{
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '').'</td>';
|
||||
print '<td align="center">';
|
||||
print ($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||
print '</td>';
|
||||
}
|
||||
print '<td align="center">'.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').'</td>';
|
||||
print '<td align="center">'.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').'</td>';
|
||||
|
||||
if (! empty($arrayfields['f.date_last_gen']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print ($objp->frequency ? dol_print_date($db->jdate($objp->date_last_gen),'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.date_when']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print ($objp->frequency ? dol_print_date($db->jdate($objp->date_when),'day') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.datec']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->datec),'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.tms']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->tms),'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td align="center">';
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
@ -1842,7 +1911,12 @@ else
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else print '<tr '.$bc[false].'><td colspan="9" class="opacitymedium">'.$langs->trans("NoneF").'</td></tr>';
|
||||
else
|
||||
{
|
||||
$colspan=1;
|
||||
foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
@ -191,7 +191,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_user='';
|
||||
$search_sale='';
|
||||
|
||||
@ -68,7 +68,7 @@ $accountstatic=new Account($db);
|
||||
*/
|
||||
|
||||
// If click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref='';
|
||||
$search_amount='';
|
||||
|
||||
@ -77,7 +77,7 @@ $extrafields = new ExtraFields($db);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_account="";
|
||||
|
||||
@ -57,7 +57,7 @@ $search_ref = GETPOST('search_ref','alpha');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ $ligne=new LignePrelevement($db,$user);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_line="";
|
||||
$search_bon="";
|
||||
|
||||
@ -79,7 +79,7 @@ else
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
|
||||
@ -71,7 +71,7 @@ else
|
||||
$typeid=$_REQUEST['typeid'];
|
||||
}
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
|
||||
@ -74,7 +74,7 @@ else
|
||||
$typeid=$_REQUEST['typeid'];
|
||||
}
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
|
||||
@ -122,7 +122,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
|
||||
@ -108,7 +108,7 @@ class Contact extends CommonObject
|
||||
$this->db = $db;
|
||||
$this->statut = 1; // By default, status is enabled
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load indicators into this->nb for board
|
||||
*
|
||||
@ -117,10 +117,10 @@ class Contact extends CommonObject
|
||||
function load_state_board()
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
||||
$this->nb=array();
|
||||
$clause = "WHERE";
|
||||
|
||||
|
||||
$sql = "SELECT count(sp.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
@ -133,7 +133,7 @@ class Contact extends CommonObject
|
||||
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
|
||||
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
|
||||
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
|
||||
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -410,7 +410,9 @@ class Contact extends CommonObject
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
// Object classes
|
||||
$info = array();
|
||||
|
||||
// Object classes
|
||||
$info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS);
|
||||
|
||||
$this->fullname=$this->getFullName($langs);
|
||||
@ -486,7 +488,7 @@ class Contact extends CommonObject
|
||||
$result=false;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Mis a jour contact
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET";
|
||||
$sql.= " birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
|
||||
@ -544,7 +546,7 @@ class Contact extends CommonObject
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
@ -659,7 +661,7 @@ class Contact extends CommonObject
|
||||
$this->canvas = $obj->canvas;
|
||||
|
||||
$this->import_key = $obj->import_key;
|
||||
|
||||
|
||||
// Define gender according to civility
|
||||
$this->setGenderFromCivility();
|
||||
|
||||
@ -735,7 +737,7 @@ class Contact extends CommonObject
|
||||
|
||||
/**
|
||||
* Set property ->gender from property ->civility_id
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function setGenderFromCivility()
|
||||
@ -746,8 +748,8 @@ class Contact extends CommonObject
|
||||
} else if(in_array($this->civility_id, array('MME','MLE'))) {
|
||||
$this->gender = 'woman';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load number of elements the contact is used as a link for
|
||||
* ref_facturation
|
||||
@ -1007,13 +1009,13 @@ class Contact extends CommonObject
|
||||
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
|
||||
$label.= '<br><b>' . $langs->trans("Phone") . ':</b> '.join(', ',$phonelist);
|
||||
$label.= '<br><b>' . $langs->trans("Address") . ':</b> '.dol_format_address($this, 1, ' ', $langs);
|
||||
|
||||
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'"';
|
||||
$linkclose="";
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowContact");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.= ' class="classfortooltip">';
|
||||
@ -1029,15 +1031,15 @@ class Contact extends CommonObject
|
||||
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
|
||||
|
||||
$link.=$linkclose;
|
||||
|
||||
|
||||
$linkend='</a>';
|
||||
|
||||
|
||||
if ($option == 'xxx')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/contact/card.php?id='.$this->id.$moreparam.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
}
|
||||
|
||||
|
||||
if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
|
||||
$result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
|
||||
return $result;
|
||||
|
||||
@ -146,7 +146,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$day='';
|
||||
$month='';
|
||||
|
||||
@ -152,7 +152,7 @@ if (empty($reshook))
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_name="";
|
||||
$search_contract="";
|
||||
|
||||
@ -4169,6 +4169,9 @@ abstract class CommonObject
|
||||
$optionsArray = $extrafields->attributes[$this->table_element]['label'];
|
||||
}
|
||||
|
||||
$table_element = $this->table_element;
|
||||
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
|
||||
|
||||
// Request to get complementary values
|
||||
if (count($optionsArray) > 0)
|
||||
{
|
||||
@ -4180,7 +4183,7 @@ abstract class CommonObject
|
||||
$sql.= ", ".$name;
|
||||
}
|
||||
}
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.$table_element."_extrafields";
|
||||
$sql.= " WHERE fk_object = ".$rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG);
|
||||
@ -4226,7 +4229,10 @@ abstract class CommonObject
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
$table_element = $this->table_element;
|
||||
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::deleteExtraFields delete", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql_del);
|
||||
if (! $resql)
|
||||
@ -4332,11 +4338,14 @@ abstract class CommonObject
|
||||
}
|
||||
$this->db->begin();
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
$table_element = $this->table_element;
|
||||
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG);
|
||||
$this->db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$table_element."_extrafields (fk_object";
|
||||
foreach($new_array_options as $key => $value)
|
||||
{
|
||||
$attributeKey = substr($key,8); // Remove 'options_' prefix
|
||||
@ -4646,18 +4655,17 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* Get buy price to use for margin calculation. This function is called when buy price is unknown.
|
||||
* set buy price = sell price if ForceBuyingPriceIfNull configured,
|
||||
* Set buy price = sell price if ForceBuyingPriceIfNull configured,
|
||||
* else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice
|
||||
* else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice
|
||||
* else set min buy price as buy price
|
||||
*
|
||||
* @param float $unitPrice product unit price
|
||||
* @param float $discountPercent line discount percent
|
||||
* @param int $fk_product product id
|
||||
*
|
||||
* @return float <0 if ko, buyprice if ok
|
||||
* @param float $unitPrice Product unit price
|
||||
* @param float $discountPercent Line discount percent
|
||||
* @param int $fk_product Product id
|
||||
* @return float <0 if KO, buyprice if OK
|
||||
*/
|
||||
public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product = 0)
|
||||
public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -4964,6 +4972,8 @@ abstract class CommonObject
|
||||
|
||||
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
|
||||
|
||||
$keys=array();
|
||||
$values = array();
|
||||
foreach ($fields as $k => $v) {
|
||||
$keys[] = $k;
|
||||
$values[] = $this->quote($v);
|
||||
|
||||
@ -197,6 +197,7 @@ class ExtraFields
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
|
||||
$table=$elementtype.'_extrafields';
|
||||
if ($elementtype == 'categorie') $table='categories_extrafields';
|
||||
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
{
|
||||
@ -350,6 +351,7 @@ class ExtraFields
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
|
||||
$table=$elementtype.'_extrafields';
|
||||
if ($elementtype == 'categorie') $table='categories_extrafields';
|
||||
|
||||
$error=0;
|
||||
|
||||
@ -460,6 +462,7 @@ class ExtraFields
|
||||
if ($elementtype == 'contact') $elementtype='socpeople';
|
||||
|
||||
$table=$elementtype.'_extrafields';
|
||||
if ($elementtype == 'categorie') $table='categories_extrafields';
|
||||
|
||||
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2006 Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
|
||||
@ -5845,11 +5845,11 @@ class Form
|
||||
* @param string $morehtmlright More html code to show after ref.
|
||||
* @return string Portion HTML with ref + navigation buttons
|
||||
*/
|
||||
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
|
||||
{
|
||||
global $langs,$conf,$hookmanager;
|
||||
function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
|
||||
{
|
||||
global $langs,$conf,$hookmanager;
|
||||
|
||||
$ret='';
|
||||
$ret='';
|
||||
if (empty($fieldid)) $fieldid='rowid';
|
||||
if (empty($fieldref)) $fieldref='ref';
|
||||
|
||||
@ -5880,10 +5880,10 @@ class Form
|
||||
// Right part of banner
|
||||
if ($morehtmlright) $ret.='<div class="inline-block floatleft">'.$morehtmlright.'</div>';
|
||||
|
||||
if ($previous_ref || $next_ref || $morehtml)
|
||||
{
|
||||
$ret.='<div class="pagination"><ul>';
|
||||
}
|
||||
if ($previous_ref || $next_ref || $morehtml)
|
||||
{
|
||||
$ret.='<div class="pagination"><ul>';
|
||||
}
|
||||
if ($morehtml)
|
||||
{
|
||||
$ret.='<li class="noborder litext">'.$morehtml.'</li>';
|
||||
@ -5914,7 +5914,7 @@ class Form
|
||||
{
|
||||
$ret.=dol_htmlentities($object->name);
|
||||
}
|
||||
else if (in_array($object->element, array('contact', 'user', 'member')))
|
||||
else if (in_array($object->element, array('contact', 'user', 'usergroup', 'member')))
|
||||
{
|
||||
$ret.=dol_htmlentities($object->getFullName($langs));
|
||||
}
|
||||
|
||||
@ -25,13 +25,13 @@ require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
|
||||
/**
|
||||
* Class to offer components to list and upload files
|
||||
*/
|
||||
class FormMailing extends Form
|
||||
class FormMailing extends Form
|
||||
{
|
||||
public $errors=array();
|
||||
|
||||
/**
|
||||
* Output a select with destinaries status
|
||||
*
|
||||
*
|
||||
* @param string $selectedid The selected id
|
||||
* @param string $htmlname Name of controm
|
||||
* @param integer $show_empty Show empty option
|
||||
@ -46,7 +46,7 @@ class FormMailing extends Form
|
||||
$mailing = new Mailing($this->db);
|
||||
|
||||
$options = array();
|
||||
|
||||
|
||||
if ($show_empty) {
|
||||
$options[-2] = ''; // Note -1 is used for error
|
||||
}
|
||||
|
||||
@ -112,21 +112,33 @@ class Utils
|
||||
}
|
||||
|
||||
$count=0;
|
||||
$countdeleted=0;
|
||||
$counterror=0;
|
||||
if (count($filesarray))
|
||||
{
|
||||
foreach($filesarray as $key => $value)
|
||||
{
|
||||
//print "x ".$filesarray[$key]['fullname']."<br>\n";
|
||||
//print "x ".$filesarray[$key]['fullname']."-".$filesarray[$key]['type']."<br>\n";
|
||||
if ($filesarray[$key]['type'] == 'dir')
|
||||
{
|
||||
$count+=dol_delete_dir_recursive($filesarray[$key]['fullname']);
|
||||
$startcount=0;
|
||||
$tmpcountdeleted=0;
|
||||
$result=dol_delete_dir_recursive($filesarray[$key]['fullname'], $startcount, 1, 0, $tmpcountdeleted);
|
||||
$count+=$result;
|
||||
$countdeleted+=$tmpcountdeleted;
|
||||
}
|
||||
elseif ($filesarray[$key]['type'] == 'file')
|
||||
{
|
||||
// If (file that is not logfile) or (if logfile with option logfile)
|
||||
if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile')
|
||||
{
|
||||
$count+=(dol_delete_file($filesarray[$key]['fullname'])?1:0);
|
||||
$result=dol_delete_file($filesarray[$key]['fullname'], 1, 1);
|
||||
if ($result)
|
||||
{
|
||||
$count++;
|
||||
$countdeleted++;
|
||||
}
|
||||
else $counterror++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -140,8 +152,12 @@ class Utils
|
||||
}
|
||||
}
|
||||
|
||||
if ($count > 0) $this->output=$langs->trans("PurgeNDirectoriesDeleted", $count);
|
||||
else $this->output=$langs->trans("PurgeNothingToDelete");
|
||||
if ($count > 0)
|
||||
{
|
||||
$this->output=$langs->trans("PurgeNDirectoriesDeleted", $countdeleted);
|
||||
if ($count > $countdeleted) $this->output.='<br>'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted));
|
||||
}
|
||||
else $this->output=$langs->trans("PurgeNothingToDelete").($choice == 'tempfilesold' ? ' (older than 24h)':'');
|
||||
|
||||
//return $count;
|
||||
return 0; // This function can be called by cron so must return 0 if OK
|
||||
|
||||
@ -1113,12 +1113,13 @@ function dol_delete_dir($dir,$nophperrors=0)
|
||||
* Remove a directory $dir and its subdirectories (or only files and subdirectories)
|
||||
*
|
||||
* @param string $dir Dir to delete
|
||||
* @param int $count Counter to count nb of deleted elements
|
||||
* @param int $count Counter to count nb of elements found to delete
|
||||
* @param int $nophperrors Disable all PHP output errors
|
||||
* @param int $onlysub Delete only files and subdir, not main directory
|
||||
* @return int Number of files and directory removed
|
||||
* @param int $countdeleted Counter to count nb of elements found really deleted
|
||||
* @return int Number of files and directory we try to remove. NB really removed is returned into $countdeleted.
|
||||
*/
|
||||
function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0)
|
||||
function dol_delete_dir_recursive($dir, $count=0, $nophperrors=0, $onlysub=0, &$countdeleted=0)
|
||||
{
|
||||
dol_syslog("functions.lib:dol_delete_dir_recursive ".$dir,LOG_DEBUG);
|
||||
if (dol_is_dir($dir))
|
||||
@ -1134,13 +1135,13 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0)
|
||||
{
|
||||
if (is_dir(dol_osencode("$dir/$item")))
|
||||
{
|
||||
$count=dol_delete_dir_recursive("$dir/$item",$count,$nophperrors);
|
||||
$count=dol_delete_dir_recursive("$dir/$item", $count, $nophperrors, 0, $countdeleted);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_delete_file("$dir/$item",1,$nophperrors);
|
||||
$result=dol_delete_file("$dir/$item", 1, $nophperrors);
|
||||
$count++;
|
||||
//echo " removing $dir/$item<br>\n";
|
||||
if ($result) $countdeleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1148,14 +1149,13 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0,$onlysub=0)
|
||||
|
||||
if (empty($onlysub))
|
||||
{
|
||||
dol_delete_dir($dir,$nophperrors);
|
||||
$count++;
|
||||
//echo "removing $dir<br>\n";
|
||||
$result=dol_delete_dir($dir, $nophperrors);
|
||||
$count++;
|
||||
if ($result) $countdeleted++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//echo "return=".$count;
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2000-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
*
|
||||
@ -407,7 +407,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
|
||||
{
|
||||
case 'none':
|
||||
break;
|
||||
case 'int':
|
||||
case 'int': // Check param is a numeric value (integer but also float or hexadecimal)
|
||||
if (! is_numeric($out)) { $out=''; }
|
||||
break;
|
||||
case 'intcomma':
|
||||
|
||||
@ -55,6 +55,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
|
||||
{
|
||||
include_once $pathoffiletoeditsrc;
|
||||
if (class_exists($objectname)) $object=new $objectname($db);
|
||||
else return -1;
|
||||
|
||||
// Backup old file
|
||||
dol_copy($pathoffiletoeditsrc, $pathoffiletoeditsrc.'.back', $newmask, 1);
|
||||
@ -109,7 +110,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask)
|
||||
|
||||
//file_put_contents($pathoffiletoedittmp, $contentclass);
|
||||
file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
|
||||
@chmod($pathoffiletoedit, octdec($newmask));
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -139,6 +140,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
|
||||
{
|
||||
dol_include_once(strtolower($module).'/class/'.strtolower($objectname).'.class.php');
|
||||
if (class_exists($objectname)) $object=new $objectname($db);
|
||||
else return -1;
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
@ -171,7 +173,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
|
||||
$contentsql = preg_replace('/-- BEGIN MODULEBUILDER FIELDS.*END MODULEBUILDER FIELDS/ims', $texttoinsert, $contentsql);
|
||||
|
||||
file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
@chmod($pathoffiletoedit, octdec($newmask));
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
|
||||
|
||||
// Edit .key.sql file
|
||||
@ -199,7 +201,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask)
|
||||
$contentsql = preg_replace('/-- BEGIN MODULEBUILDER INDEXES.*END MODULEBUILDER INDEXES/ims', $texttoinsert, $contentsql);
|
||||
|
||||
file_put_contents($pathoffiletoedittarget, $contentsql);
|
||||
@chmod($pathoffiletoedit, octdec($newmask));
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -83,14 +83,14 @@ class modProduct extends DolibarrModules
|
||||
$this->const[$r][3] = 'Module to control product codes';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
|
||||
/*$this->const[$r][0] = "PRODUCT_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "standard";
|
||||
$this->const[$r][3] = 'Default module for document generation';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;*/
|
||||
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_produits.php','enabledbydefaulton'=>'Home'),
|
||||
@ -133,7 +133,7 @@ class modProduct extends DolibarrModules
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
|
||||
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
|
||||
/* We can't enable this here because it must be enabled in both product and service module and this create duplicate insert
|
||||
$r=0;
|
||||
@ -159,7 +159,7 @@ class modProduct extends DolibarrModules
|
||||
$this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_permission[$r]=array(array("produit","export"));
|
||||
$this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.width'=>"Width",'p.height'=>"Height",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.customcode'=>'CustomCode','p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.tobuy'=>"OnBuy",'p.datec'=>'DateCreation','p.tms'=>'DateModification');
|
||||
if ($mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['p.recuperableonly']='NPR';
|
||||
if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.stock'=>'Stock','p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
||||
if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('p.barcode'=>'BarCode'));
|
||||
if (! empty($conf->fournisseur->enabled)) $this->export_fields_array[$r]=array_merge($this->export_fields_array[$r],array('s.nom'=>'Supplier','pf.ref_fourn'=>'SupplierRef','pf.unitprice'=>'SuppliersPrices'));
|
||||
@ -189,7 +189,7 @@ class modProduct extends DolibarrModules
|
||||
if (! empty($conf->fournisseur->enabled)) $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price as pf ON pf.fk_product = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'societe s ON s.rowid = pf.fk_soc';
|
||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
|
||||
if (! empty($conf->global->EXPORTTOOL_CATEGORIES)) $this->export_sql_order[$r] =' GROUP BY p.rowid'; // FIXME The group by used a generic value to say "all fields in select except function fields"
|
||||
|
||||
|
||||
if (! empty($conf->global->PRODUIT_MULTIPRICES))
|
||||
{
|
||||
// Exports product multiprice
|
||||
@ -203,7 +203,7 @@ class modProduct extends DolibarrModules
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
'pr.date_price'=>'DateCreation');
|
||||
if ($mysoc->useNPR()) $this->export_fields_array[$r]['pr.recuperableonly']='NPR';
|
||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->export_fields_array[$r]['pr.recuperableonly']='NPR';
|
||||
//$this->export_TypeFields_array[$r]=array('p.ref'=>"Text",'p.label'=>"Text",'p.description'=>"Text",'p.url'=>"Text",'p.accountancy_code_sell'=>"Text",'p.accountancy_code_buy'=>"Text",'p.note'=>"Text",'p.length'=>"Numeric",'p.surface'=>"Numeric",'p.volume'=>"Numeric",'p.weight'=>"Numeric",'p.customcode'=>'Text','p.price_base_type'=>"Text",'p.price'=>"Numeric",'p.price_ttc'=>"Numeric",'p.tva_tx'=>'Numeric','p.tosell'=>"Boolean",'p.tobuy'=>"Boolean",'p.datec'=>'Date','p.tms'=>'Date');
|
||||
$this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",
|
||||
'pr.price_base_type'=>"product",'pr.price_level'=>"product",'pr.price'=>"product",
|
||||
@ -246,7 +246,7 @@ class modProduct extends DolibarrModules
|
||||
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'product_association as pa, '.MAIN_DB_PREFIX.'product as p2';
|
||||
$this->export_sql_end[$r] .=' WHERE p.fk_product_type = 0 AND p.entity IN ('.getEntity('product').')';
|
||||
$this->export_sql_end[$r] .=' AND p.rowid = pa.fk_product_pere AND p2.rowid = pa.fk_product_fils';
|
||||
}
|
||||
}
|
||||
|
||||
// Imports
|
||||
//--------
|
||||
@ -262,7 +262,7 @@ class modProduct extends DolibarrModules
|
||||
$this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.url'=>"PublicUrl",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.duration'=>"Duration",'p.customcode'=>'CustomCode','p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.tobuy'=>"OnBuy*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.datec'=>'DateCreation');
|
||||
if (! empty($conf->stock->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.seuil_stock_alerte'=>'StockLimit','p.desiredstock'=>'DesiredStock','p.pmp'=>'PMPValue'));
|
||||
if (! empty($conf->fournisseur->enabled) || !empty($conf->margin->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.cost_price'=>'CostPrice'));
|
||||
if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR'));
|
||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.recuperableonly'=>'NPR'));
|
||||
if (! empty($conf->barcode->enabled)) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('p.barcode'=>'BarCode'));
|
||||
// Add extra fields
|
||||
$import_extrafield_sample=array();
|
||||
@ -331,7 +331,7 @@ class modProduct extends DolibarrModules
|
||||
'pr.price_min'=>"MinPriceLevelUnitPriceHT",'pr.price_min_ttc'=>"MinPriceLevelUnitPriceTTC",
|
||||
'pr.tva_tx'=>'PriceLevelVATRate',
|
||||
'pr.date_price'=>'DateCreation*');
|
||||
if ($mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('pr.recuperableonly'=>'NPR'));
|
||||
if (is_object($mysoc) && $mysoc->useNPR()) $this->import_fields_array[$r]=array_merge($this->import_fields_array[$r],array('pr.recuperableonly'=>'NPR'));
|
||||
$this->import_regex_array[$r]=array('pr.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','pr.recuperableonly'=>'^[0|1]$');
|
||||
$this->import_examplevalues_array[$r]=array('pr.fk_product'=>"1",
|
||||
'pr.price_base_type'=>"HT",'pr.price_level'=>"1",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2011-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -55,7 +55,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
// Proposals to order
|
||||
if ($action == 'PROPAL_CLOSE_SIGNED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_PROPAL_AUTOCREATE_ORDER))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
@ -74,7 +74,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
// Order to invoice
|
||||
if ($action == 'ORDER_CLOSE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
if (! empty($conf->facture->enabled) && ! empty($conf->global->WORKFLOW_ORDER_AUTOCREATE_INVOICE))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@ -90,77 +90,116 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Order classify billed proposal
|
||||
if ($action == 'ORDER_CLASSIFY_BILLED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
if (! empty($conf->propal->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL))
|
||||
{
|
||||
$object->fetchObjectLinked('','propal',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
$totalonlinkedelements=0;
|
||||
foreach($object->linkedObjects['propal'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
|
||||
}
|
||||
dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of order = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
|
||||
if ($totalonlinkedelements == $object->total_ht)
|
||||
{
|
||||
foreach($object->linkedObjects['propal'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// Invoice classify billed order
|
||||
if ($action == 'BILL_PAYED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// classify billed order
|
||||
if ($action == 'BILL_VALIDATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
|
||||
if (! empty($conf->propal->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL))
|
||||
{
|
||||
$object->fetchObjectLinked('','propal',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
foreach($object->linkedObjects['propal'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
$totalonlinkedelements=0;
|
||||
foreach($object->linkedObjects['propal'] as $element)
|
||||
{
|
||||
if ($element->statut == Propal::STATUS_SIGNED || $element->statut == Propal::STATUS_BILLED) $totalonlinkedelements += $element->total_ht;
|
||||
}
|
||||
dol_syslog("Amount of linked proposals = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
|
||||
if ($totalonlinkedelements == $object->total_ht)
|
||||
{
|
||||
foreach($object->linkedObjects['propal'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
$totalonlinkedelements=0;
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
|
||||
}
|
||||
dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
|
||||
if ($totalonlinkedelements == $object->total_ht)
|
||||
{
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action=='SHIPPING_VALIDATE') {
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
// Invoice classify billed order
|
||||
if ($action == 'BILL_PAYED')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER))
|
||||
{
|
||||
$object->fetchObjectLinked('','commande',$object->id,$object->element);
|
||||
if (! empty($object->linkedObjects))
|
||||
{
|
||||
$totalonlinkedelements=0;
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
if ($element->statut == Commande::STATUS_VALIDATED || $element->statut == Commande::STATUS_SHIPMENTONPROCESS || $element->statut == Commande::STATUS_CLOSED) $totalonlinkedelements += $element->total_ht;
|
||||
}
|
||||
dol_syslog("Amount of linked orders = ".$totalonlinkedelements.", of invoice = ".$object->total_ht.", egality is ".($totalonlinkedelements == $object->total_ht), LOG_DEBUG);
|
||||
if ($totalonlinkedelements == $object->total_ht)
|
||||
{
|
||||
foreach($object->linkedObjects['commande'] as $element)
|
||||
{
|
||||
$ret=$element->classifyBilled($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action=='SHIPPING_VALIDATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id, LOG_DEBUG);
|
||||
|
||||
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->expedition->enabled) && ! empty($conf->global->WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING))
|
||||
|
||||
@ -62,10 +62,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Module not active, we do nothing
|
||||
if (empty($conf->agenda->enabled)) {
|
||||
return 0;
|
||||
}
|
||||
if (empty($conf->agenda->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
$key = 'MAIN_AGENDA_ACTIONAUTO_'.$action;
|
||||
|
||||
@ -651,25 +648,25 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
$langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("projects");
|
||||
|
||||
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("ProjectValidatedInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
|
||||
|
||||
|
||||
$object->sendtoid=0;
|
||||
}
|
||||
elseif($action == 'PROJECT_MODIFY') {
|
||||
$langs->load("agenda");
|
||||
$langs->load("other");
|
||||
$langs->load("projects");
|
||||
|
||||
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities("ProjectModifieddInDolibarr",$object->ref);
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref;
|
||||
|
||||
|
||||
$object->sendtoid=0;
|
||||
}
|
||||
|
||||
|
||||
// Project tasks
|
||||
elseif($action == 'TASK_CREATE') {
|
||||
$langs->load("agenda");
|
||||
@ -708,18 +705,18 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
}
|
||||
// TODO Merge all previous cases into this generic one
|
||||
else {
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function)
|
||||
// Note: We are here only if $conf->global->MAIN_AGENDA_ACTIONAUTO_action is on (tested at begining of this function)
|
||||
$langs->load("agenda");
|
||||
$langs->load("other");
|
||||
|
||||
|
||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities($action."InDolibarr",$object->ref);
|
||||
$object->actionmsg=$langs->transnoentities($action."InDolibarr",$object->ref);
|
||||
|
||||
|
||||
$object->sendtoid=0;
|
||||
}
|
||||
|
||||
|
||||
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
|
||||
|
||||
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
// Add entry in event table
|
||||
@ -783,7 +780,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
$actioncomm->elementtype = $object->element;
|
||||
|
||||
$ret=$actioncomm->create($user); // User creating action
|
||||
|
||||
|
||||
if ($ret > 0 && $conf->global->MAIN_COPY_FILE_IN_EVENT_AUTO)
|
||||
{
|
||||
if (is_array($object->attachedfiles) && array_key_exists('paths',$object->attachedfiles) && count($object->attachedfiles['paths'])>0) {
|
||||
@ -798,9 +795,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action.
|
||||
|
||||
|
||||
if ($ret > 0)
|
||||
{
|
||||
$_SESSION['LAST_ACTION_CREATED'] = $ret;
|
||||
|
||||
@ -46,10 +46,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Do not log events not enabled for this action
|
||||
if (empty($conf->blockedlog->enabled)) {
|
||||
return 0;
|
||||
}
|
||||
if (empty($conf->blockedlog->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
if($action==='BILL_VALIDATE' || $action === 'BILL_PAYED' || $action==='BILL_UNPAYED'
|
||||
|| $action === 'BILL_SENTBYMAIL' || $action === 'DOC_DOWNLOAD' || $action === 'DOC_PREVIEW') {
|
||||
|
||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT."/user/class/usergroup.class.php";
|
||||
*/
|
||||
class InterfaceMailmanSpipsynchro extends DolibarrTriggers
|
||||
{
|
||||
public $family = 'ldap';
|
||||
public $family = 'mailmanspip';
|
||||
public $description = "Triggers of this module allows to synchronize Mailman an Spip.";
|
||||
public $version = self::VERSION_DOLIBARR;
|
||||
public $picto = 'technic';
|
||||
@ -51,12 +51,6 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
|
||||
{
|
||||
if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
if (! function_exists('ldap_connect'))
|
||||
{
|
||||
dol_syslog("Warning, module LDAP is enabled but LDAP functions not available in this PHP", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ($action == 'CATEGORY_LINK')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
@ -65,7 +65,7 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
|
||||
$notify = new Notify($this->db);
|
||||
|
||||
|
||||
if (! in_array($action, $notify->arrayofnotifsupported)) return 0;
|
||||
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
@ -1,275 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/triggers/interface_90_all_Demo.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de demo de personalisation des actions du workflow
|
||||
* \remarks Son propre fichier d'actions peut etre cree par recopie de celui-ci:
|
||||
* - Le nom du fichier doit etre: interface_99_modMymodule_Mytrigger.class.php
|
||||
* ou: interface_99_all_Mytrigger.class.php
|
||||
* - Le fichier doit rester stocke dans core/triggers
|
||||
* - Le nom de la classe doit etre InterfaceMytrigger
|
||||
* - Le nom de la propriete name doit etre Mytrigger
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class of triggers for demo module
|
||||
*/
|
||||
class InterfaceDemo extends DolibarrTriggers
|
||||
{
|
||||
|
||||
public $family = 'demo';
|
||||
public $picto = 'technic';
|
||||
public $description = "Triggers of this module are empty functions. They have no effect. They are provided for tutorial purpose only.";
|
||||
public $version = self::VERSION_DOLIBARR;
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object concerned. Some context information may also be provided into array property object->context.
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||
// Data and type of action are stored into $object and $action
|
||||
|
||||
switch ($action) {
|
||||
|
||||
// Users
|
||||
case 'USER_CREATE':
|
||||
case 'USER_MODIFY':
|
||||
case 'USER_NEW_PASSWORD':
|
||||
case 'USER_ENABLEDISABLE':
|
||||
case 'USER_DELETE':
|
||||
case 'USER_SETINGROUP':
|
||||
case 'USER_REMOVEFROMGROUP':
|
||||
|
||||
case 'USER_LOGIN':
|
||||
case 'USER_LOGIN_FAILED':
|
||||
case 'USER_LOGOUT':
|
||||
|
||||
// Actions
|
||||
case 'ACTION_MODIFY':
|
||||
case 'ACTION_CREATE':
|
||||
case 'ACTION_DELETE':
|
||||
|
||||
// Groups
|
||||
case 'GROUP_CREATE':
|
||||
case 'GROUP_MODIFY':
|
||||
case 'GROUP_DELETE':
|
||||
|
||||
// Companies
|
||||
case 'COMPANY_CREATE':
|
||||
case 'COMPANY_MODIFY':
|
||||
case 'COMPANY_DELETE':
|
||||
|
||||
// Contacts
|
||||
case 'CONTACT_CREATE':
|
||||
case 'CONTACT_MODIFY':
|
||||
case 'CONTACT_DELETE':
|
||||
case 'CONTACT_ENABLEDISABLE':
|
||||
|
||||
// Products
|
||||
case 'PRODUCT_CREATE':
|
||||
case 'PRODUCT_MODIFY':
|
||||
case 'PRODUCT_DELETE':
|
||||
case 'PRODUCT_PRICE_MODIFY':
|
||||
case 'PRODUCT_SET_MULTILANGS':
|
||||
case 'PRODUCT_DEL_MULTILANGS':
|
||||
|
||||
//Stock mouvement
|
||||
case 'STOCK_MOVEMENT':
|
||||
|
||||
//MYECMDIR
|
||||
case 'MYECMDIR_DELETE':
|
||||
case 'MYECMDIR_CREATE':
|
||||
case 'MYECMDIR_MODIFY':
|
||||
|
||||
// Customer orders
|
||||
case 'ORDER_CREATE':
|
||||
case 'ORDER_CLONE':
|
||||
case 'ORDER_VALIDATE':
|
||||
case 'ORDER_DELETE':
|
||||
case 'ORDER_CANCEL':
|
||||
case 'ORDER_SENTBYMAIL':
|
||||
case 'ORDER_CLASSIFY_BILLED':
|
||||
case 'ORDER_SETDRAFT':
|
||||
case 'LINEORDER_INSERT':
|
||||
case 'LINEORDER_UPDATE':
|
||||
case 'LINEORDER_DELETE':
|
||||
|
||||
// Supplier orders
|
||||
case 'ORDER_SUPPLIER_CREATE':
|
||||
case 'ORDER_SUPPLIER_CLONE':
|
||||
case 'ORDER_SUPPLIER_VALIDATE':
|
||||
case 'ORDER_SUPPLIER_DELETE':
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
case 'ORDER_SUPPLIER_CANCEL':
|
||||
case 'ORDER_SUPPLIER_SENTBYMAIL':
|
||||
case 'ORDER_SUPPLIER_DISPATCH':
|
||||
case 'LINEORDER_SUPPLIER_DISPATCH':
|
||||
case 'LINEORDER_SUPPLIER_CREATE':
|
||||
case 'LINEORDER_SUPPLIER_UPDATE':
|
||||
|
||||
// Proposals
|
||||
case 'PROPAL_CREATE':
|
||||
case 'PROPAL_CLONE':
|
||||
case 'PROPAL_MODIFY':
|
||||
case 'PROPAL_VALIDATE':
|
||||
case 'PROPAL_SENTBYMAIL':
|
||||
case 'PROPAL_CLOSE_SIGNED':
|
||||
case 'PROPAL_CLOSE_REFUSED':
|
||||
case 'PROPAL_DELETE':
|
||||
case 'LINEPROPAL_INSERT':
|
||||
case 'LINEPROPAL_UPDATE':
|
||||
case 'LINEPROPAL_DELETE':
|
||||
|
||||
// SupplierProposal
|
||||
case 'SUPPLIER_PROPOSAL_CREATE':
|
||||
case 'SUPPLIER_PROPOSAL_CLONE':
|
||||
case 'SUPPLIER_PROPOSAL_MODIFY':
|
||||
case 'SUPPLIER_PROPOSAL_VALIDATE':
|
||||
case 'SUPPLIER_PROPOSAL_SENTBYMAIL':
|
||||
case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED':
|
||||
case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED':
|
||||
case 'SUPPLIER_PROPOSAL_DELETE':
|
||||
case 'LINESUPPLIER_PROPOSAL_INSERT':
|
||||
case 'LINESUPPLIER_PROPOSAL_UPDATE':
|
||||
case 'LINESUPPLIER_PROPOSAL_DELETE':
|
||||
|
||||
// Contracts
|
||||
case 'CONTRACT_CREATE':
|
||||
case 'CONTRACT_ACTIVATE':
|
||||
case 'CONTRACT_CANCEL':
|
||||
case 'CONTRACT_CLOSE':
|
||||
case 'CONTRACT_DELETE':
|
||||
case 'LINECONTRACT_INSERT':
|
||||
case 'LINECONTRACT_UPDATE':
|
||||
case 'LINECONTRACT_DELETE':
|
||||
|
||||
// Bills
|
||||
case 'BILL_CREATE':
|
||||
case 'BILL_CLONE':
|
||||
case 'BILL_MODIFY':
|
||||
case 'BILL_VALIDATE':
|
||||
case 'BILL_UNVALIDATE':
|
||||
case 'BILL_SENTBYMAIL':
|
||||
case 'BILL_CANCEL':
|
||||
case 'BILL_DELETE':
|
||||
case 'BILL_PAYED':
|
||||
case 'LINEBILL_INSERT':
|
||||
case 'LINEBILL_UPDATE':
|
||||
case 'LINEBILL_DELETE':
|
||||
|
||||
//Supplier Bill
|
||||
case 'BILL_SUPPLIER_CREATE':
|
||||
case 'BILL_SUPPLIER_UPDATE':
|
||||
case 'BILL_SUPPLIER_DELETE':
|
||||
case 'BILL_SUPPLIER_PAYED':
|
||||
case 'BILL_SUPPLIER_UNPAYED':
|
||||
case 'BILL_SUPPLIER_VALIDATE':
|
||||
case 'BILL_SUPPLIER_UNVALIDATE':
|
||||
case 'LINEBILL_SUPPLIER_CREATE':
|
||||
case 'LINEBILL_SUPPLIER_UPDATE':
|
||||
case 'LINEBILL_SUPPLIER_DELETE':
|
||||
|
||||
// Payments
|
||||
case 'PAYMENT_CUSTOMER_CREATE':
|
||||
case 'PAYMENT_SUPPLIER_CREATE':
|
||||
case 'PAYMENT_ADD_TO_BANK':
|
||||
case 'PAYMENT_DELETE':
|
||||
|
||||
// Online
|
||||
case 'PAYMENT_PAYBOX_OK':
|
||||
case 'PAYMENT_PAYPAL_OK':
|
||||
case 'PAYMENT_STRIPE_OK':
|
||||
|
||||
// Donation
|
||||
case 'DON_CREATE':
|
||||
case 'DON_UPDATE':
|
||||
case 'DON_DELETE':
|
||||
|
||||
// Interventions
|
||||
case 'FICHINTER_CREATE':
|
||||
case 'FICHINTER_MODIFY':
|
||||
case 'FICHINTER_VALIDATE':
|
||||
case 'FICHINTER_DELETE':
|
||||
case 'LINEFICHINTER_CREATE':
|
||||
case 'LINEFICHINTER_UPDATE':
|
||||
case 'LINEFICHINTER_DELETE':
|
||||
|
||||
// Members
|
||||
case 'MEMBER_CREATE':
|
||||
case 'MEMBER_VALIDATE':
|
||||
case 'MEMBER_SUBSCRIPTION':
|
||||
case 'MEMBER_MODIFY':
|
||||
case 'MEMBER_NEW_PASSWORD':
|
||||
case 'MEMBER_RESILIATE':
|
||||
case 'MEMBER_DELETE':
|
||||
|
||||
// Categories
|
||||
case 'CATEGORY_CREATE':
|
||||
case 'CATEGORY_MODIFY':
|
||||
case 'CATEGORY_DELETE':
|
||||
case 'CATEGORY_SET_MULTILANGS':
|
||||
|
||||
// Projects
|
||||
case 'PROJECT_CREATE':
|
||||
case 'PROJECT_MODIFY':
|
||||
case 'PROJECT_DELETE':
|
||||
|
||||
// Project tasks
|
||||
case 'TASK_CREATE':
|
||||
case 'TASK_MODIFY':
|
||||
case 'TASK_DELETE':
|
||||
|
||||
// Task time spent
|
||||
case 'TASK_TIMESPENT_CREATE':
|
||||
case 'TASK_TIMESPENT_MODIFY':
|
||||
case 'TASK_TIMESPENT_DELETE':
|
||||
|
||||
// Shipping
|
||||
case 'SHIPPING_CREATE':
|
||||
case 'SHIPPING_MODIFY':
|
||||
case 'SHIPPING_VALIDATE':
|
||||
case 'SHIPPING_SENTBYMAIL':
|
||||
case 'SHIPPING_BILLED':
|
||||
case 'SHIPPING_CLOSED':
|
||||
case 'SHIPPING_REOPEN':
|
||||
case 'SHIPPING_DELETE':
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@ -78,7 +78,7 @@ $object = new Cronjob($db);
|
||||
*/
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_label='';
|
||||
$status=-1;
|
||||
@ -115,19 +115,19 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
{
|
||||
$object = new Cronjob($db);
|
||||
$job = $object->fetch($id);
|
||||
|
||||
|
||||
$now = dol_now(); // Date we start
|
||||
|
||||
|
||||
$resrunjob = $object->run_jobs($user->login); // Return -1 if KO, 1 if OK
|
||||
if ($resrunjob < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
||||
// Programm next run
|
||||
$res = $object->reprogram_jobs($user->login, $now);
|
||||
if ($res > 0)
|
||||
{
|
||||
if ($resrunjob >= 0) // We add result of reprogram ony if no error message already reported
|
||||
if ($resrunjob >= 0) // We add result of reprogram ony if no error message already reported
|
||||
{
|
||||
if ($object->lastresult >= 0) setEventMessages($langs->trans("JobFinished"), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("JobFinished"), null, 'errors');
|
||||
@ -139,7 +139,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
header("Location: ".DOL_URL_ROOT.'/cron/list.php?status=-2'); // Make a call to avoid to run twice job when using back
|
||||
exit;
|
||||
}
|
||||
@ -352,10 +352,10 @@ if ($num > 0)
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
|
||||
if (! verifCond($obj->test)) continue; // Discard line with test = false
|
||||
|
||||
|
||||
// title profil
|
||||
if ($style=='pair') {$style='impair';}
|
||||
else {$style='pair';}
|
||||
@ -391,7 +391,7 @@ if ($num > 0)
|
||||
$texttoshow.='<br>'.$langs->trans('CronArgs').': '. $obj->params;
|
||||
$texttoshow.='<br>'.$langs->trans('Comment').': '. $langs->trans($obj->note);
|
||||
}
|
||||
elseif ($obj->jobtype=='command')
|
||||
elseif ($obj->jobtype=='command')
|
||||
{
|
||||
$text=$langs->trans('CronCommand');
|
||||
$texttoshow=$langs->trans('CronCommand').': '.dol_trunc($obj->command);
|
||||
@ -419,7 +419,7 @@ if ($num > 0)
|
||||
print '<td align="right">';
|
||||
if (!empty($obj->maxrun)) {print $obj->maxrun;}
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="right">';
|
||||
if (!empty($obj->nbrun)) {print $obj->nbrun;} else {print '0';}
|
||||
print '</td>';
|
||||
@ -468,7 +468,7 @@ if ($num > 0)
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ $optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
if (!$user->rights->don->lire) accessforbidden();
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_all="";
|
||||
$search_ref="";
|
||||
|
||||
@ -127,7 +127,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref_exp='';
|
||||
$search_ref_liv='';
|
||||
|
||||
@ -140,7 +140,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test must be present to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_user="";
|
||||
|
||||
@ -141,7 +141,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_company="";
|
||||
|
||||
@ -68,7 +68,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
$search_agenda_label='';
|
||||
|
||||
@ -185,7 +185,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$ordermonth='';
|
||||
$orderyear='';
|
||||
|
||||
@ -64,7 +64,7 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield="f.date_lim_reglement";
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_ref_supplier="";
|
||||
|
||||
@ -194,7 +194,7 @@ if (empty($reshook))
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All test must be present to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All test must be present to be compatible with all browsers
|
||||
{
|
||||
$search_all="";
|
||||
$search_user='';
|
||||
|
||||
@ -95,7 +95,7 @@ $arrayfields=array();
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_account="";
|
||||
|
||||
@ -82,7 +82,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$sref = '';
|
||||
$sRefSupplier = '';
|
||||
|
||||
@ -84,7 +84,7 @@ if (empty($reshook))
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_name='';
|
||||
$toselect='';
|
||||
|
||||
@ -81,7 +81,7 @@ $fieldstosearchall = array(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$month_create="";
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL;
|
||||
|
||||
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
|
||||
-- -- VMYSQL4.1 ALTER TABLE llx_adherent MODIFY COLUMN datefin datetime DEFAULT '2001-01-01 00:00:00';
|
||||
-- VMYSQL4.1 update llx_adherent set datefin = NULL where DATE(STR_TO_DATE(datefin, '%Y-%m-%d')) IS NULL;
|
||||
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
|
||||
-- VMYSQL4.1 update llx_adherent set datefin = NULL where DATE(STR_TO_DATE(datefin, '%Y-%m-%d')) IS NULL;
|
||||
@ -74,7 +75,7 @@ ALTER TABLE llx_holiday ADD COLUMN ref varchar(30) NULL;
|
||||
ALTER TABLE llx_holiday ADD COLUMN ref_ext varchar(255);
|
||||
|
||||
|
||||
create table llx_notify_def_object
|
||||
CREATE TABLE llx_notify_def_object
|
||||
(
|
||||
id integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
@ -129,14 +130,15 @@ ALTER TABLE llx_bank_account ADD COLUMN extraparams varchar(255);
|
||||
-- VMYSQL4.1 ALTER TABLE llx_adherent MODIFY COLUMN country integer DEFAULT NULL;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_adherent MODIFY COLUMN country integer USING country::integer;
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30);
|
||||
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203);
|
||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203);
|
||||
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204);
|
||||
|
||||
ALTER TABLE llx_c_email_templates ADD COLUMN content_lines text;
|
||||
|
||||
@ -156,6 +158,8 @@ ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key varchar(14);
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN import_key varchar(14);
|
||||
|
||||
ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp;
|
||||
UPDATE llx_facture_rec SET tms = datec where tms < '2000-01-01';
|
||||
|
||||
CREATE TABLE llx_product_attribute
|
||||
(
|
||||
@ -196,7 +200,7 @@ CREATE TABLE llx_product_attribute_combination
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE llx_bank_account drop foreign key bank_fk_accountancy_journal;
|
||||
ALTER TABLE llx_bank_account DROP FOREIGN KEY bank_fk_accountancy_journal;
|
||||
|
||||
-- Fix missing entity column after init demo
|
||||
ALTER TABLE llx_accounting_journal ADD COLUMN entity integer DEFAULT 1;
|
||||
@ -209,18 +213,18 @@ INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (
|
||||
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Has new journal', 9, 1);
|
||||
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (6,'ER', 'Expense report journal', 5, 1);
|
||||
-- Fix old entries
|
||||
UPDATE llx_accounting_journal SET nature = 1 where code = 'OD' and nature = 0;
|
||||
UPDATE llx_accounting_journal SET nature = 2 where code = 'VT' and nature = 1;
|
||||
UPDATE llx_accounting_journal SET nature = 3 where code = 'AC' and nature = 2;
|
||||
UPDATE llx_accounting_journal SET nature = 4 where (code = 'BK' or code = 'BQ') and nature = 3;
|
||||
UPDATE llx_accounting_journal SET nature = 1 WHERE code = 'OD' AND nature = 0;
|
||||
UPDATE llx_accounting_journal SET nature = 2 WHERE code = 'VT' AND nature = 1;
|
||||
UPDATE llx_accounting_journal SET nature = 3 WHERE code = 'AC' AND nature = 2;
|
||||
UPDATE llx_accounting_journal SET nature = 4 WHERE (code = 'BK' OR code = 'BQ') AND nature = 3;
|
||||
|
||||
UPDATE llx_bank_account as ba set accountancy_journal = 'BQ' where accountancy_journal = 'BK';
|
||||
UPDATE llx_bank_account as ba set accountancy_journal = 'OD' where accountancy_journal IS NULL;
|
||||
UPDATE llx_bank_account SET accountancy_journal = 'BQ' WHERE accountancy_journal = 'BK';
|
||||
UPDATE llx_bank_account SET accountancy_journal = 'OD' WHERE accountancy_journal IS NULL;
|
||||
|
||||
ALTER TABLE llx_bank_account ADD COLUMN fk_accountancy_journal integer;
|
||||
ALTER TABLE llx_bank_account ADD INDEX idx_fk_accountancy_journal (fk_accountancy_journal);
|
||||
|
||||
UPDATE llx_bank_account as ba set fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal as aj where ba.accountancy_journal = aj.code) where accountancy_journal not in ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
|
||||
UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
|
||||
ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
|
||||
|
||||
--Update general ledger for FEC format & harmonization
|
||||
@ -233,7 +237,7 @@ ALTER TABLE llx_accounting_bookkeeping ADD COLUMN subledger_account varchar(32);
|
||||
ALTER TABLE llx_accounting_bookkeeping CHANGE COLUMN thirdparty_label subledger_label varchar(255); -- If field was already created, rename it
|
||||
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN subledger_label varchar(255) AFTER subledger_account; -- If field dod not exists yet
|
||||
|
||||
update llx_accounting_bookkeeping set subledger_account = numero_compte where subledger_account IS NULL;
|
||||
UPDATE llx_accounting_bookkeeping SET subledger_account = numero_compte WHERE subledger_account IS NULL;
|
||||
|
||||
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN label_compte varchar(255);
|
||||
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN code_journal varchar(32);
|
||||
@ -358,9 +362,9 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d
|
||||
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
|
||||
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
|
||||
|
||||
UPDATE llx_contrat set ref = rowid where ref is null or ref = '';
|
||||
UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = '';
|
||||
|
||||
create table llx_payment_various
|
||||
CREATE TABLE llx_payment_various
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp,
|
||||
@ -381,7 +385,7 @@ create table llx_payment_various
|
||||
)ENGINE=innodb;
|
||||
|
||||
|
||||
create table llx_default_values
|
||||
CREATE TABLE llx_default_values
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
@ -441,27 +445,27 @@ ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_tms (tms);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_datec (datec);
|
||||
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory);
|
||||
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) VALUES (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
|
||||
INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) VALUES (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
|
||||
INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) VALUES (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
|
||||
INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) VALUES (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
|
||||
|
||||
ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
|
||||
|
||||
ALTER TABLE llx_facture ADD COLUMN fk_fac_rec_source integer;
|
||||
|
||||
DELETE from llx_c_actioncomm where code in ('AC_PROP','AC_COM','AC_FAC','AC_SHIP','AC_SUP_ORD','AC_SUP_INV') AND id NOT IN (SELECT DISTINCT fk_action FROM llx_actioncomm);
|
||||
DELETE FROM llx_c_actioncomm WHERE code IN ('AC_PROP','AC_COM','AC_FAC','AC_SHIP','AC_SUP_ORD','AC_SUP_INV') AND id NOT IN (SELECT DISTINCT fk_action FROM llx_actioncomm);
|
||||
|
||||
-- Fix: delete orphelin category.
|
||||
delete from llx_categorie_product where fk_categorie not in (select rowid from llx_categorie where type = 0);
|
||||
delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type in (1, 2));
|
||||
delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3);
|
||||
delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4);
|
||||
delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 5);
|
||||
DELETE FROM llx_categorie_product WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 0);
|
||||
DELETE FROM llx_categorie_societe WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type IN (1, 2));
|
||||
DELETE FROM llx_categorie_member WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 3);
|
||||
DELETE FROM llx_categorie_contact WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 4);
|
||||
DELETE FROM llx_categorie_project WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 5);
|
||||
|
||||
ALTER TABLE llx_inventory ADD COLUMN ref varchar(48);
|
||||
|
||||
create table llx_loan_schedule
|
||||
CREATE TABLE llx_loan_schedule
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_loan integer,
|
||||
@ -518,6 +522,9 @@ ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pa
|
||||
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);
|
||||
|
||||
|
||||
UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories';
|
||||
|
||||
|
||||
-- For new module blockedlog
|
||||
|
||||
CREATE TABLE llx_blockedlog
|
||||
@ -559,3 +566,6 @@ ALTER TABLE llx_blockedlog_authority ADD INDEX signature (signature);
|
||||
|
||||
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
|
||||
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';
|
||||
UPDATE llx_bank SET label= '(payment_salary)' WHERE label LIKE 'Règlement salaire';
|
||||
|
||||
ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255);
|
||||
|
||||
@ -25,7 +25,8 @@ create table llx_facture_rec
|
||||
titre varchar(50) NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
fk_soc integer NOT NULL,
|
||||
datec datetime, -- date de creation
|
||||
datec datetime, -- date de creation
|
||||
tms timestamp, -- date creation/modification
|
||||
|
||||
amount double(24,8) DEFAULT 0 NOT NULL,
|
||||
remise real DEFAULT 0,
|
||||
|
||||
@ -30,7 +30,7 @@ create table llx_mailing_cibles
|
||||
other varchar(255) NULL,
|
||||
tag varchar(128) NULL,
|
||||
statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ...
|
||||
source_url varchar(160),
|
||||
source_url varchar(255),
|
||||
source_id integer,
|
||||
source_type varchar(16),
|
||||
date_envoi datetime,
|
||||
|
||||
@ -102,6 +102,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_rec FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_fourn FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_fourn_det_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
|
||||
|
||||
@ -194,7 +194,7 @@ ValidateHistory=Bind Automatically
|
||||
AutomaticBindingDone=Automatic binding done
|
||||
|
||||
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
|
||||
MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s
|
||||
MvtNotCorrectlyBalanced=Movement not correctly balanced. Credit = %s. Debit = %s
|
||||
FicheVentilation=Binding card
|
||||
GeneralLedgerIsWritten=Transactions are written in the Ledger
|
||||
GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be dispatched. If there is no other error message, this is probably because they were already dispatched.
|
||||
|
||||
@ -147,6 +147,7 @@ PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory <b>%s</b>. Tempo
|
||||
PurgeRunNow=Purge now
|
||||
PurgeNothingToDelete=No directory or files to delete.
|
||||
PurgeNDirectoriesDeleted=<b>%s</b> files or directories deleted.
|
||||
PurgeNDirectoriesFailed=Failed to delete <b>%s</b> files or directories.
|
||||
PurgeAuditEvents=Purge all security events
|
||||
ConfirmPurgeAuditEvents=Are you sure you want to purge all security events? All security logs will be deleted, no other data will be removed.
|
||||
GenerateBackup=Generate backup
|
||||
@ -298,7 +299,7 @@ SetupIsReadyForUse=Module deployment is finished. You must however enable and se
|
||||
NotExistsDirect=The alternative root directory is not defined to an existing directory.<br>
|
||||
InfDirAlt=Since version 3, it is possible to define an alternative root directory. This allows you to store, into a dedicated directory, plug-ins and custom templates.<br>Just create a directory at the root of Dolibarr (eg: custom).<br>
|
||||
InfDirExample=<br>Then declare it in the file <strong>conf.php</strong><br> $dolibarr_main_url_root_alt='http://myserver/custom'<br>$dolibarr_main_document_root_alt='/path/of/dolibarr/htdocs/custom'<br>If these lines are commented with "#", to enable them, just uncomment by removing the "#" character.
|
||||
YouCanSubmitFile=For this step, you can send package using this tool: Select module file
|
||||
YouCanSubmitFile=For this step, you can submit your package file here :
|
||||
CurrentVersion=Dolibarr current version
|
||||
CallUpdatePage=Go to the page that updates the database structure and data: %s.
|
||||
LastStableVersion=Latest stable version
|
||||
|
||||
@ -151,7 +151,7 @@ CheckRejectedAndInvoicesReopened=Check returned and invoices reopened
|
||||
BankAccountModelModule=Document templates for bank accounts
|
||||
DocumentModelSepaMandate=Template of SEPA mandate. Usefull for european countries in EEC only.
|
||||
DocumentModelBan=Template to print a page with BAN information.
|
||||
NewVariousPayment=New various payment
|
||||
VariousPayment=Various payment
|
||||
VariousPayments=Various payments
|
||||
ShowVariousPayment=Show various payment
|
||||
NewVariousPayment=New miscellaneous payment
|
||||
VariousPayment=Miscellaneous payment
|
||||
VariousPayments=Miscellaneous payments
|
||||
ShowVariousPayment=Show miscellaneous payment
|
||||
|
||||
@ -4,7 +4,8 @@ ErrorAddRateFail=Error in added rate
|
||||
ErrorAddCurrencyFail=Error in added currency
|
||||
ErrorDeleteCurrencyFail=Error delete fail
|
||||
multicurrency_syncronize_error=Synchronisation error: %s
|
||||
multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the new known rate)
|
||||
MULTICURRENCY_USE_RATE_ON_DOCUMENT_DATE=Use date of document to find currency rate, instead of using latest known rate
|
||||
multicurrency_useOriginTx=When an object is created from another, keep the original rate of source object (otherwise use the latest known rate)
|
||||
CurrencyLayerAccount=CurrencyLayer API
|
||||
CurrencyLayerAccount_help_to_synchronize=You sould create an account on their website to use this functionnality<br />Get your <b>API key</b><br />If you use a free account you can't change the <b>currency source</b> (USD by default)<br />But if your main currency isn't USD you can use the <b>alternate currency source</b> to force you main currency<br /><br />You are limited at 1000 synchronizations per month
|
||||
multicurrency_appId=API key
|
||||
|
||||
@ -2,14 +2,16 @@
|
||||
WorkflowSetup=Workflow module setup
|
||||
WorkflowDesc=This module is designed to modify the behaviour of automatic actions into application. By default, workflow is open (you can do things in the order you want). You can activate the automatic actions you are interested in.
|
||||
ThereIsNoWorkflowToModify=There is no workflow modifications available with the activated modules.
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed
|
||||
# Autocreate
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_ORDER=Automatically create a customer order after a commercial proposal is signed (new order will have same amount than proposal)
|
||||
descWORKFLOW_PROPAL_AUTOCREATE_INVOICE=Automatically create a customer invoice after a commercial proposal is signed (new invoice will have same amount than proposal)
|
||||
descWORKFLOW_CONTRACT_AUTOCREATE_INVOICE=Automatically create a customer invoice after a contract is validated
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer order is set to paid
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid
|
||||
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal to billed when customer invoice is validated
|
||||
descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source order to shipped when a shipment is validated and quantity shipped is the same as in order
|
||||
descWORKFLOW_ORDER_AUTOCREATE_INVOICE=Automatically create a customer invoice after a customer order is closed (new invoice will have same amount than order)
|
||||
# Autoclassify
|
||||
descWORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL=Classify linked source proposal(s) to billed when customer order is set to billed (and if amount of the order is same than total amount of signed linked proposals)
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL=Classify linked source proposal(s) to billed when customer invoice is validated (and if amount of the invoice is same than total amount of signed linked proposals)
|
||||
descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is validated (and if amount of the invoice is same than total amount of linked orders)
|
||||
descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid (and if amount of the invoice is same than total amount of linked orders)
|
||||
descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source order to shipped when a shipment is validated (and if quantity shipped by all shipments is the same as in the order to update)
|
||||
AutomaticCreation=Automatic creation
|
||||
AutomaticClassification=Automatic classification
|
||||
@ -55,7 +55,7 @@ $filtre=GETPOST("filtre");
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_label="";
|
||||
|
||||
@ -103,7 +103,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref='';
|
||||
$search_array_options=array();
|
||||
|
||||
@ -97,439 +97,221 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
|
||||
*/
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||
if (!empty($conf->mymodule->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||
// Data and type of action are stored into $object and $action
|
||||
|
||||
/** Users */
|
||||
if ($action == 'USER_LOGIN') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_UPDATE_SESSION') {
|
||||
// Warning: To increase performances, this action is triggered only if
|
||||
// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_CREATE_FROM_CONTACT') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_NEW_PASSWORD') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_ENABLEDISABLE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_LOGOUT') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_SETINGROUP') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'USER_REMOVEFROMGROUP') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
switch ($action) {
|
||||
|
||||
/** Groups */
|
||||
} elseif ($action == 'GROUP_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'GROUP_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'GROUP_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Users
|
||||
case 'USER_CREATE':
|
||||
case 'USER_MODIFY':
|
||||
case 'USER_NEW_PASSWORD':
|
||||
case 'USER_ENABLEDISABLE':
|
||||
case 'USER_DELETE':
|
||||
case 'USER_SETINGROUP':
|
||||
case 'USER_REMOVEFROMGROUP':
|
||||
|
||||
/** Companies */
|
||||
} elseif ($action == 'COMPANY_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'COMPANY_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'COMPANY_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
case 'USER_LOGIN':
|
||||
case 'USER_LOGIN_FAILED':
|
||||
case 'USER_LOGOUT':
|
||||
case 'USER_UPDATE_SESSION': // Warning: To increase performances, this action is triggered only if constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
|
||||
|
||||
/** Contacts */
|
||||
} elseif ($action == 'CONTACT_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTACT_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTACT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Products
|
||||
} elseif ($action == 'PRODUCT_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PRODUCT_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PRODUCT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Actions
|
||||
case 'ACTION_MODIFY':
|
||||
case 'ACTION_CREATE':
|
||||
case 'ACTION_DELETE':
|
||||
|
||||
/** Customer orders */
|
||||
} elseif ($action == 'ORDER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_CLONE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_BUILDDOC') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_SENTBYMAIL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEORDER_INSERT') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEORDER_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Groups
|
||||
case 'GROUP_CREATE':
|
||||
case 'GROUP_MODIFY':
|
||||
case 'GROUP_DELETE':
|
||||
|
||||
/** Supplier orders */
|
||||
} elseif ($action == 'ORDER_SUPPLIER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_SUPPLIER_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SUPPLIER_ORDER_BUILDDOC') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Companies
|
||||
case 'COMPANY_CREATE':
|
||||
case 'COMPANY_MODIFY':
|
||||
case 'COMPANY_DELETE':
|
||||
|
||||
/** Proposals */
|
||||
} elseif ($action == 'PROPAL_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_CLONE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_BUILDDOC') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_SENTBYMAIL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_CLOSE_SIGNED') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_CLOSE_REFUSED') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROPAL_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEPROPAL_INSERT') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEPROPAL_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEPROPAL_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Contacts
|
||||
case 'CONTACT_CREATE':
|
||||
case 'CONTACT_MODIFY':
|
||||
case 'CONTACT_DELETE':
|
||||
case 'CONTACT_ENABLEDISABLE':
|
||||
|
||||
/** Contracts */
|
||||
} elseif ($action == 'CONTRACT_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTRACT_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTRACT_ACTIVATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTRACT_CANCEL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTRACT_CLOSE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CONTRACT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Products
|
||||
case 'PRODUCT_CREATE':
|
||||
case 'PRODUCT_MODIFY':
|
||||
case 'PRODUCT_DELETE':
|
||||
case 'PRODUCT_PRICE_MODIFY':
|
||||
case 'PRODUCT_SET_MULTILANGS':
|
||||
case 'PRODUCT_DEL_MULTILANGS':
|
||||
|
||||
/** Bills */
|
||||
} elseif ($action == 'BILL_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_CLONE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_BUILDDOC') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_SENTBYMAIL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_CANCEL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'BILL_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEBILL_INSERT') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'LINEBILL_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
//Stock mouvement
|
||||
case 'STOCK_MOVEMENT':
|
||||
|
||||
/** Payments */
|
||||
} elseif ($action == 'PAYMENT_CUSTOMER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PAYMENT_SUPPLIER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PAYMENT_ADD_TO_BANK') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PAYMENT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
//MYECMDIR
|
||||
case 'MYECMDIR_DELETE':
|
||||
case 'MYECMDIR_CREATE':
|
||||
case 'MYECMDIR_MODIFY':
|
||||
|
||||
/** Interventions */
|
||||
} elseif ($action == 'FICHEINTER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'FICHEINTER_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'FICHEINTER_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'FICHEINTER_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Customer orders
|
||||
case 'ORDER_CREATE':
|
||||
case 'ORDER_CLONE':
|
||||
case 'ORDER_VALIDATE':
|
||||
case 'ORDER_DELETE':
|
||||
case 'ORDER_CANCEL':
|
||||
case 'ORDER_SENTBYMAIL':
|
||||
case 'ORDER_CLASSIFY_BILLED':
|
||||
case 'ORDER_SETDRAFT':
|
||||
case 'LINEORDER_INSERT':
|
||||
case 'LINEORDER_UPDATE':
|
||||
case 'LINEORDER_DELETE':
|
||||
|
||||
/** Members */
|
||||
} elseif ($action == 'MEMBER_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_SUBSCRIPTION') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_NEW_PASSWORD') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_RESILIATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'MEMBER_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Supplier orders
|
||||
case 'ORDER_SUPPLIER_CREATE':
|
||||
case 'ORDER_SUPPLIER_CLONE':
|
||||
case 'ORDER_SUPPLIER_VALIDATE':
|
||||
case 'ORDER_SUPPLIER_DELETE':
|
||||
case 'ORDER_SUPPLIER_APPROVE':
|
||||
case 'ORDER_SUPPLIER_REFUSE':
|
||||
case 'ORDER_SUPPLIER_CANCEL':
|
||||
case 'ORDER_SUPPLIER_SENTBYMAIL':
|
||||
case 'ORDER_SUPPLIER_DISPATCH':
|
||||
case 'LINEORDER_SUPPLIER_DISPATCH':
|
||||
case 'LINEORDER_SUPPLIER_CREATE':
|
||||
case 'LINEORDER_SUPPLIER_UPDATE':
|
||||
|
||||
/** Categories */
|
||||
} elseif ($action == 'CATEGORY_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CATEGORY_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'CATEGORY_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Proposals
|
||||
case 'PROPAL_CREATE':
|
||||
case 'PROPAL_CLONE':
|
||||
case 'PROPAL_MODIFY':
|
||||
case 'PROPAL_VALIDATE':
|
||||
case 'PROPAL_SENTBYMAIL':
|
||||
case 'PROPAL_CLOSE_SIGNED':
|
||||
case 'PROPAL_CLOSE_REFUSED':
|
||||
case 'PROPAL_DELETE':
|
||||
case 'LINEPROPAL_INSERT':
|
||||
case 'LINEPROPAL_UPDATE':
|
||||
case 'LINEPROPAL_DELETE':
|
||||
|
||||
/** Projects */
|
||||
} elseif ($action == 'PROJECT_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROJECT_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'PROJECT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
/** Project tasks */
|
||||
} elseif ($action == 'TASK_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'TASK_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'TASK_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// SupplierProposal
|
||||
case 'SUPPLIER_PROPOSAL_CREATE':
|
||||
case 'SUPPLIER_PROPOSAL_CLONE':
|
||||
case 'SUPPLIER_PROPOSAL_MODIFY':
|
||||
case 'SUPPLIER_PROPOSAL_VALIDATE':
|
||||
case 'SUPPLIER_PROPOSAL_SENTBYMAIL':
|
||||
case 'SUPPLIER_PROPOSAL_CLOSE_SIGNED':
|
||||
case 'SUPPLIER_PROPOSAL_CLOSE_REFUSED':
|
||||
case 'SUPPLIER_PROPOSAL_DELETE':
|
||||
case 'LINESUPPLIER_PROPOSAL_INSERT':
|
||||
case 'LINESUPPLIER_PROPOSAL_UPDATE':
|
||||
case 'LINESUPPLIER_PROPOSAL_DELETE':
|
||||
|
||||
/** Task time spent */
|
||||
} elseif ($action == 'TASK_TIMESPENT_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'TASK_TIMESPENT_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'TASK_TIMESPENT_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Contracts
|
||||
case 'CONTRACT_CREATE':
|
||||
case 'CONTRACT_ACTIVATE':
|
||||
case 'CONTRACT_CANCEL':
|
||||
case 'CONTRACT_CLOSE':
|
||||
case 'CONTRACT_DELETE':
|
||||
case 'LINECONTRACT_INSERT':
|
||||
case 'LINECONTRACT_UPDATE':
|
||||
case 'LINECONTRACT_DELETE':
|
||||
|
||||
/** Shipping */
|
||||
} elseif ($action == 'SHIPPING_CREATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SHIPPING_MODIFY') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SHIPPING_VALIDATE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SHIPPING_SENTBYMAIL') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SHIPPING_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'SHIPPING_BUILDDOC') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
// Bills
|
||||
case 'BILL_CREATE':
|
||||
case 'BILL_CLONE':
|
||||
case 'BILL_MODIFY':
|
||||
case 'BILL_VALIDATE':
|
||||
case 'BILL_UNVALIDATE':
|
||||
case 'BILL_SENTBYMAIL':
|
||||
case 'BILL_CANCEL':
|
||||
case 'BILL_DELETE':
|
||||
case 'BILL_PAYED':
|
||||
case 'LINEBILL_INSERT':
|
||||
case 'LINEBILL_UPDATE':
|
||||
case 'LINEBILL_DELETE':
|
||||
|
||||
/** File */
|
||||
} elseif ($action == 'FILE_UPLOAD') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
} elseif ($action == 'FILE_DELETE') {
|
||||
dol_syslog(
|
||||
"Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id
|
||||
);
|
||||
}
|
||||
//Supplier Bill
|
||||
case 'BILL_SUPPLIER_CREATE':
|
||||
case 'BILL_SUPPLIER_UPDATE':
|
||||
case 'BILL_SUPPLIER_DELETE':
|
||||
case 'BILL_SUPPLIER_PAYED':
|
||||
case 'BILL_SUPPLIER_UNPAYED':
|
||||
case 'BILL_SUPPLIER_VALIDATE':
|
||||
case 'BILL_SUPPLIER_UNVALIDATE':
|
||||
case 'LINEBILL_SUPPLIER_CREATE':
|
||||
case 'LINEBILL_SUPPLIER_UPDATE':
|
||||
case 'LINEBILL_SUPPLIER_DELETE':
|
||||
|
||||
// Payments
|
||||
case 'PAYMENT_CUSTOMER_CREATE':
|
||||
case 'PAYMENT_SUPPLIER_CREATE':
|
||||
case 'PAYMENT_ADD_TO_BANK':
|
||||
case 'PAYMENT_DELETE':
|
||||
|
||||
// Online
|
||||
case 'PAYMENT_PAYBOX_OK':
|
||||
case 'PAYMENT_PAYPAL_OK':
|
||||
case 'PAYMENT_STRIPE_OK':
|
||||
|
||||
// Donation
|
||||
case 'DON_CREATE':
|
||||
case 'DON_UPDATE':
|
||||
case 'DON_DELETE':
|
||||
|
||||
// Interventions
|
||||
case 'FICHINTER_CREATE':
|
||||
case 'FICHINTER_MODIFY':
|
||||
case 'FICHINTER_VALIDATE':
|
||||
case 'FICHINTER_DELETE':
|
||||
case 'LINEFICHINTER_CREATE':
|
||||
case 'LINEFICHINTER_UPDATE':
|
||||
case 'LINEFICHINTER_DELETE':
|
||||
|
||||
// Members
|
||||
case 'MEMBER_CREATE':
|
||||
case 'MEMBER_VALIDATE':
|
||||
case 'MEMBER_SUBSCRIPTION':
|
||||
case 'MEMBER_MODIFY':
|
||||
case 'MEMBER_NEW_PASSWORD':
|
||||
case 'MEMBER_RESILIATE':
|
||||
case 'MEMBER_DELETE':
|
||||
|
||||
// Categories
|
||||
case 'CATEGORY_CREATE':
|
||||
case 'CATEGORY_MODIFY':
|
||||
case 'CATEGORY_DELETE':
|
||||
case 'CATEGORY_SET_MULTILANGS':
|
||||
|
||||
// Projects
|
||||
case 'PROJECT_CREATE':
|
||||
case 'PROJECT_MODIFY':
|
||||
case 'PROJECT_DELETE':
|
||||
|
||||
// Project tasks
|
||||
case 'TASK_CREATE':
|
||||
case 'TASK_MODIFY':
|
||||
case 'TASK_DELETE':
|
||||
|
||||
// Task time spent
|
||||
case 'TASK_TIMESPENT_CREATE':
|
||||
case 'TASK_TIMESPENT_MODIFY':
|
||||
case 'TASK_TIMESPENT_DELETE':
|
||||
|
||||
// Shipping
|
||||
case 'SHIPPING_CREATE':
|
||||
case 'SHIPPING_MODIFY':
|
||||
case 'SHIPPING_VALIDATE':
|
||||
case 'SHIPPING_SENTBYMAIL':
|
||||
case 'SHIPPING_BILLED':
|
||||
case 'SHIPPING_CLOSED':
|
||||
case 'SHIPPING_REOPEN':
|
||||
case 'SHIPPING_DELETE':
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled to increase speed. Language code is found on url.
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled. Language code is found on url.
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations
|
||||
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
|
||||
@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
session_cache_limiter(FALSE);
|
||||
|
||||
// Load user to have $user->conf loaded (not done into main because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
||||
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
|
||||
/*if (empty($user->id) && ! empty($_SESSION['dol_login']))
|
||||
{
|
||||
$user->fetch('',$_SESSION['dol_login']);
|
||||
|
||||
@ -13,8 +13,22 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Library javascript to enable Browser notifications
|
||||
*/
|
||||
|
||||
if (!defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1');
|
||||
if (!defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1);
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1);
|
||||
if (!defined('NOLOGIN')) define('NOLOGIN', 1);
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', 1);
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1);
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
|
||||
|
||||
/**
|
||||
* \file htdocs/modulebuilder/template/js/mymodule.js.php
|
||||
* \ingroup mymodule
|
||||
@ -41,4 +55,8 @@ header('Content-Type: application/javascript');
|
||||
// You can use CTRL+F5 to refresh your browser cache.
|
||||
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
else header('Cache-Control: no-cache');
|
||||
?>
|
||||
|
||||
/* Javascript library of module MyModule */
|
||||
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2
|
||||
if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include(substr($tmp, 0, ($i+1))."/main.inc.php");
|
||||
if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php");
|
||||
// Try main.inc.php using relative path
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include("../main.inc.php");
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");
|
||||
if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");
|
||||
if (! $res) die("Include of main fails");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user