Merge branch 'develop' into patch-210
This commit is contained in:
commit
540cd43596
3
.github/workflows/exakat.yml
vendored
3
.github/workflows/exakat.yml
vendored
@ -5,6 +5,9 @@ on:
|
||||
schedule:
|
||||
- cron: "0 20 * * *"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
exakat:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@ -499,8 +499,9 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/cache.manifest`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.mysql`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.nova*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.old`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.postgres`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf.php.pgsql`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/conf/conf*sav*`;
|
||||
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/mssql/README`;
|
||||
|
||||
@ -211,8 +211,7 @@ if ($num) {
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
$key_value = getDolGlobalString($conf->global->$key, $conf->global->$key);
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$key_value.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
@ -240,7 +239,7 @@ if (!$conf->use_javascript_ajax) {
|
||||
} else {
|
||||
print '<td>';
|
||||
$listmodelcsv = $accountancyexport->getType();
|
||||
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, $conf->global->ACCOUNTING_EXPORT_MODELCSV, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print $form->selectarray("ACCOUNTING_EXPORT_MODELCSV", $listmodelcsv, getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -358,7 +358,7 @@ foreach ($list as $key) {
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="right">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -414,7 +414,7 @@ foreach ($list_binding as $key) {
|
||||
$array = array(0=>$langs->trans("PreviousMonth"), 1=>$langs->trans("CurrentMonth"), 2=>$langs->trans("Fiscalyear"));
|
||||
print $form->selectarray($key, $array, (isset($conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER) ? $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER : 0));
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -207,7 +207,7 @@ if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
$listofformat = $accountancyexport->getType();
|
||||
$formatexportset = $conf->global->ACCOUNTING_EXPORT_MODELCSV;
|
||||
$formatexportset = getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV');
|
||||
if (empty($listofformat[$formatexportset])) {
|
||||
$formatexportset = 1;
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ if ($action == 'edit') {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
print '</td></tr>';
|
||||
@ -283,7 +283,7 @@ if ($action == 'create' && $user->rights->adherent->configurer) {
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" class="minwidth300" value="'.dol_escape_htmltag(GETPOST("libelle", 'alphanohtml')).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -453,10 +453,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnBOMs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'BOM_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -261,10 +261,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'BANK_CHEQUERECEIPT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -612,7 +612,7 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'ORDER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
@ -661,7 +661,7 @@ if ($conf->banque->enabled) {
|
||||
}
|
||||
|
||||
// Ask for warehouse during order
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td> </td><td class="center">';
|
||||
if (! empty($conf->use_javascript_ajax)) {
|
||||
|
||||
@ -179,7 +179,7 @@ foreach ($list as $key) {
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -445,10 +445,10 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->tr
|
||||
print '<br>';
|
||||
$variablename = 'CONTRACT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -105,7 +105,7 @@ if ($action == 'edit') {
|
||||
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {
|
||||
print $form->selectyesno($key, $conf->global->$key, 1);
|
||||
} else {
|
||||
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'">';
|
||||
print '<input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -434,10 +434,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnDeliveryReceipts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'DELIVERY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -132,7 +132,7 @@ if ($action == 'updateMask') {
|
||||
} elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == "$value") {
|
||||
if (getDolGlobalString('EXPEDITION_ADDON_PDF') == "$value") {
|
||||
dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF', $conf->entity);
|
||||
}
|
||||
}
|
||||
@ -231,7 +231,7 @@ foreach ($dirmodels as $reldir) {
|
||||
if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.urlencode($file).'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
@ -367,7 +367,7 @@ foreach ($dirmodels as $reldir) {
|
||||
|
||||
// Defaut
|
||||
print '<td class="center">';
|
||||
if ($conf->global->EXPEDITION_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString('EXPEDITION_ADDON_PDF') == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
@ -441,17 +441,17 @@ print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnShippings"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SHIPPING_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.getDolGlobalString('SHIPPING_DRAFT_WATERMARK').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -456,10 +456,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnExpenseReports"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'EXPENSEREPORT_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -743,10 +743,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'INVOICE_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -507,10 +507,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'FICHINTER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -538,10 +538,10 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
print '<br>';
|
||||
$variablename = 'HOLIDAY_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@ -107,7 +107,7 @@ foreach ($list as $key) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -446,10 +446,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnMOs"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'MRP_MO_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -675,10 +675,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'PROPOSAL_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -455,12 +455,12 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnReceptions"), $langs->t
|
||||
$variablename='RECEPTION_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
|
||||
{
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
|
||||
$doleditor=new DolEditor($variablename, getDolGlobalString($variablename),'',80,'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -194,7 +194,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -217,7 +217,7 @@ print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -457,10 +457,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnInvoices"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_INVOICE_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -505,10 +505,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -474,10 +474,10 @@ print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
|
||||
$variablename = 'SUPPLIER_PROPOSAL_FREE_TEXT';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -642,7 +642,7 @@ $mail_intro = $conf->global->TICKET_MESSAGE_MAIL_INTRO ? $conf->global->TICKET_M
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailIntroLabelAdmin");
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_INTRO', $mail_intro, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -654,7 +654,7 @@ $mail_signature = $conf->global->TICKET_MESSAGE_MAIL_SIGNATURE ? $conf->global->
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("TicketMessageMailSignatureLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
|
||||
@ -375,7 +375,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHomeLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HOME', $public_text_home, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -387,7 +387,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<tr><td>'.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_PUBLIC_TEXT_HELP_MESSAGE', $public_text_help_message, '100%', 180, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
@ -434,7 +434,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '</label>';
|
||||
print '</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, $conf->global->FCKEDITOR_ENABLE_MAIL, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('TICKET_MESSAGE_MAIL_NEW', $mail_mesg_new, '100%', 120, 'dolibarr_mailings', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAIL'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
733
htdocs/admin/webhook.php
Normal file
733
htdocs/admin/webhook.php
Normal file
@ -0,0 +1,733 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 SuperAdmin <test@dolibarr.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file webhook/admin/webhook.php
|
||||
* \ingroup webhook
|
||||
* \brief Webhook setup page.
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
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");
|
||||
}
|
||||
|
||||
global $langs, $user;
|
||||
|
||||
// Libraries
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/lib/webhook.lib.php';
|
||||
|
||||
// Translations
|
||||
$langs->loadLangs(array("admin", "webhook"));
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('webhooksetup', 'globalsetup'));
|
||||
|
||||
// Access control
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
|
||||
|
||||
$value = GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scan_dir', 'alpha');
|
||||
$type = 'myobject';
|
||||
|
||||
$arrayofparameters = array(
|
||||
'WEBHOOK_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>0),
|
||||
//'WEBHOOK_MYPARAM2'=>array('type'=>'textarea','enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
//'WEBHOOK_MYPARAM7'=>array('type'=>'product', 'enabled'=>1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
$setupnotempty = 0;
|
||||
|
||||
// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
|
||||
$useFormSetup = 0;
|
||||
// Convert arrayofparameter into a formSetup object
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
$formSetup = new FormSetup($db);
|
||||
|
||||
// you can use the param convertor
|
||||
$formSetup->addItemsFromParamsArray($arrayofparameters);
|
||||
|
||||
// or use the new system see exemple as follow (or use both because you can ;-) )
|
||||
|
||||
/*
|
||||
// Hôte
|
||||
$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
|
||||
$item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
|
||||
$item->cssClass = 'minwidth500';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple string input
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM1');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM1 as a simple textarea input but we replace the text of field title
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM2');
|
||||
$item->nameText = $item->getNameText().' more html text ';
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM3
|
||||
$item = $formSetup->newItem('WEBHOOK_MYPARAM3');
|
||||
$item->setAsThirdpartyType();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM4 : exemple of quick define write style
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM4')->setAsYesNo();
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM5
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM5')->setAsEmailTemplate('thirdparty');
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM6
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
|
||||
|
||||
// Setup conf WEBHOOK_MYPARAM7
|
||||
$formSetup->newItem('WEBHOOK_MYPARAM7')->setAsProduct();
|
||||
*/
|
||||
|
||||
$setupnotempty = count($formSetup->items);
|
||||
}
|
||||
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconst', 'alpha');
|
||||
$maskvalue = GETPOST('maskvalue', 'alpha');
|
||||
|
||||
if ($maskconst) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'specimen') {
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
|
||||
$tmpobject = new $tmpobjectkey($db);
|
||||
$tmpobject->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file = ''; $classname = ''; $filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
||||
if ($module->write_file($tmpobject, $langs) > 0) {
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($module->error, null, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
} elseif ($action == 'setmod') {
|
||||
// TODO Check if numbering module chosen can be activated by calling method canBeActivated
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey)."_ADDON";
|
||||
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
} elseif ($action == 'set') {
|
||||
// Activate a model
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
} elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'setdoc') {
|
||||
// Set or unset default model
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
|
||||
// The constant that was read before the new set
|
||||
// We therefore requires a variable to have a coherent view
|
||||
$conf->global->$constforval = $value;
|
||||
}
|
||||
|
||||
// We disable/enable the document template (into llx_document_model table)
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'unsetdoc') {
|
||||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = '';
|
||||
$page_name = "WebhookSetup";
|
||||
|
||||
llxHeader('', $langs->trans($page_name), $help_url);
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
// Configuration header
|
||||
$head = webhookAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "webhook@webhook");
|
||||
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("WebhookSetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
print $formSetup->generateOutput(true);
|
||||
} else {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
print '<span id="helplink'.$constname.'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).'</span>';
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
$nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang
|
||||
//$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, '');
|
||||
$arrayofmessagename = array();
|
||||
if (is_array($formmail->lines_model)) {
|
||||
foreach ($formmail->lines_model as $modelmail) {
|
||||
//var_dump($modelmail);
|
||||
$moreonlabel = '';
|
||||
if (!empty($arrayofmessagename[$modelmail->label])) {
|
||||
$moreonlabel = ' <span class="opacitymedium">(' . $langs->trans("SeveralLangugeVariatFound") . ')</span>';
|
||||
}
|
||||
// The 'label' is the key that is unique if we exclude the language
|
||||
$arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel;
|
||||
}
|
||||
}
|
||||
print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||
}
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#generate_token'.$constname.'").click(function() {
|
||||
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
|
||||
action: \'getrandompassword\',
|
||||
generic: true
|
||||
},
|
||||
function(token) {
|
||||
$("#'.$constname.'").val(token);
|
||||
});
|
||||
});
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
} else {
|
||||
if ($useFormSetup && (float) DOL_VERSION >= 15) {
|
||||
if (!empty($formSetup->items)) {
|
||||
print $formSetup->generateOutput();
|
||||
}
|
||||
} else {
|
||||
if (!empty($arrayofparameters)) {
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br($conf->global->{$constname});
|
||||
} elseif ($val['type']== 'html') {
|
||||
print $conf->global->{$constname};
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
} elseif (preg_match('/emailtemplate:/', $val['type'])) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$tmp = explode(':', $val['type']);
|
||||
|
||||
$template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname});
|
||||
if ($template<0) {
|
||||
setEventMessages(null, $formmail->errors, 'errors');
|
||||
}
|
||||
print $langs->trans($template->label);
|
||||
} elseif (preg_match('/category:/', $val['type'])) {
|
||||
$c = new Categorie($db);
|
||||
$result = $c->fetch($conf->global->{$constname});
|
||||
if ($result < 0) {
|
||||
setEventMessages(null, $c->errors, 'errors');
|
||||
} elseif ($result > 0 ) {
|
||||
$ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text
|
||||
$toprint = array();
|
||||
foreach ($ways as $way) {
|
||||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '</li>';
|
||||
}
|
||||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if ($conf->global->{$constname}==2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif ($conf->global->{$constname}==3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif ($conf->global->{$constname}==1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif ($conf->global->{$constname}==0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
$product = new Product($db);
|
||||
$resprod = $product->fetch($conf->global->{$constname});
|
||||
if ($resprod > 0) {
|
||||
print $product->ref;
|
||||
} elseif ($resprod < 0) {
|
||||
setEventMessages(null, $object->errors, "errors");
|
||||
}
|
||||
} else {
|
||||
print $conf->global->{$constname};
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($setupnotempty) {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
} else {
|
||||
//print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$moduledir = 'webhook';
|
||||
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||
|
||||
|
||||
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
if ($myTmpObjectKey == 'MyObject') {
|
||||
continue;
|
||||
}
|
||||
if ($myTmpObjectArray['includerefgeneration']) {
|
||||
/*
|
||||
* Orders Numbering model
|
||||
*/
|
||||
$setupnotempty++;
|
||||
|
||||
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="nowrap">'.$langs->trans("Example").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$dir = dol_buildpath($reldir."core/modules/".$moduledir);
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
|
||||
$file = substr($file, 0, dol_strlen($file) - 4);
|
||||
|
||||
require_once $dir.'/'.$file.'.php';
|
||||
|
||||
$module = new $file($db);
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
continue;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($module->isEnabled()) {
|
||||
dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
|
||||
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print $module->info();
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering model
|
||||
print '<td class="nowrap">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
} else {
|
||||
print $tmp;
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$mytmpinstance = new $myTmpObjectKey($db);
|
||||
$mytmpinstance->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
$htmltooltip = '';
|
||||
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
|
||||
|
||||
$nextval = $module->getNextValue($mytmpinstance);
|
||||
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
|
||||
$htmltooltip .= ''.$langs->trans("NextValue").': ';
|
||||
if ($nextval) {
|
||||
if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
|
||||
$nextval = $langs->trans($nextval);
|
||||
}
|
||||
$htmltooltip .= $nextval.'<br>';
|
||||
} else {
|
||||
$htmltooltip .= $langs->trans($module->error).'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</table><br>\n";
|
||||
}
|
||||
|
||||
if ($myTmpObjectArray['includedocgeneration']) {
|
||||
/*
|
||||
* Document templates generators
|
||||
*/
|
||||
$setupnotempty++;
|
||||
$type = strtolower($myTmpObjectKey);
|
||||
|
||||
print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
|
||||
|
||||
// Load array def with activated templates
|
||||
$def = array();
|
||||
$sql = "SELECT nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
|
||||
$sql .= " WHERE type = '".$db->escape($type)."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$i = 0;
|
||||
$num_rows = $db->num_rows($resql);
|
||||
while ($i < $num_rows) {
|
||||
$array = $db->fetch_array($resql);
|
||||
array_push($def, $array[0]);
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
|
||||
print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
|
||||
print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
foreach ($dirmodels as $reldir) {
|
||||
foreach (array('', '/doc') as $valdir) {
|
||||
$realpath = $reldir."core/modules/".$moduledir.$valdir;
|
||||
$dir = dol_buildpath($realpath);
|
||||
|
||||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$filelist[] = $file;
|
||||
}
|
||||
closedir($handle);
|
||||
arsort($filelist);
|
||||
|
||||
foreach ($filelist as $file) {
|
||||
if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
|
||||
if (file_exists($dir.'/'.$file)) {
|
||||
$name = substr($file, 4, dol_strlen($file) - 16);
|
||||
$classname = substr($file, 0, dol_strlen($file) - 12);
|
||||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
|
||||
$modulequalified = 0;
|
||||
}
|
||||
|
||||
if ($modulequalified) {
|
||||
print '<tr class="oddeven"><td width="100">';
|
||||
print (empty($module->name) ? $name : $module->name);
|
||||
print "</td><td>\n";
|
||||
if (method_exists($module, 'info')) {
|
||||
print $module->info($langs);
|
||||
} else {
|
||||
print $module->description;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $name) {
|
||||
//print img_picto($langs->trans("Default"), 'on');
|
||||
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Info
|
||||
$htmltooltip = ''.$langs->trans("Name").': '.$module->name;
|
||||
$htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
|
||||
if ($module->type == 'pdf') {
|
||||
$htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
|
||||
}
|
||||
$htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
|
||||
|
||||
$htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
|
||||
$htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
|
||||
$htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
|
||||
|
||||
print '<td class="center">';
|
||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||
print '</td>';
|
||||
|
||||
// Preview
|
||||
print '<td class="center">';
|
||||
if ($module->type == 'pdf') {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||
} else {
|
||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($setupnotempty)) {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -112,7 +112,7 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -130,7 +130,7 @@ if ($action == 'edit') {
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -188,7 +188,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -209,7 +209,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -246,7 +246,7 @@ if ($user->rights->categorie->creer) {
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor('description', $description, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ if ($action == 'edit') {
|
||||
// Desc
|
||||
$desc = (GETPOST('desc-'.$key) ? GETPOST('desc-'.$key) : $object->multilangs[$key]['description']);
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("desc-$key", $desc, '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -323,7 +323,7 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Label').'</td>';
|
||||
print '<td><input name="libelle" class="minwidth200 maxwidth300" value="'.GETPOST('libelle', 'alpha').'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1121,7 +1121,7 @@ if ($object->id > 0) {
|
||||
* Latest contracts
|
||||
*/
|
||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) {
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql .= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
@ -1191,7 +1191,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $contrat->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
@ -1409,6 +1409,7 @@ if ($object->id > 0) {
|
||||
$sql .= ', f.total_ht';
|
||||
$sql .= ', f.total_tva';
|
||||
$sql .= ', f.total_ttc';
|
||||
$sql .= ', f.entity';
|
||||
$sql .= ', f.datef as df, f.datec as dc, f.paye as paye, f.fk_statut as status';
|
||||
$sql .= ', s.nom, s.rowid as socid';
|
||||
$sql .= ', SUM(pf.amount) as am';
|
||||
@ -1475,7 +1476,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $facturestatic->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
|
||||
@ -39,6 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
|
||||
$hookmanager = new HookManager($db);
|
||||
@ -100,6 +103,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
$supplierorderstatic = new CommandeFournisseur($db);
|
||||
}
|
||||
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$fichinterstatic = new Fichinter($db);
|
||||
}
|
||||
|
||||
llxHeader("", $langs->trans("CommercialArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
|
||||
@ -508,7 +515,12 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
* Draft interventionals
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid";
|
||||
$sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut";
|
||||
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
|
||||
$sql .= ", s.code_client, s.code_compta, s.client";
|
||||
$sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.fournisseur";
|
||||
$sql .= ", s.logo, s.email, s.entity";
|
||||
$sql .= ", s.canvas";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
if (empty($user->rights->societe->client->voir) && !$socid) {
|
||||
@ -524,22 +536,46 @@ if (!empty($conf->ficheinter->enabled)) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
}
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$nbofloop = min($num, $maxofloop);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th colspan="2">'.$langs->trans("DraftFichinter").'</th></tr>';
|
||||
$langs->load("fichinter");
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num) {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
while ($i < $nbofloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$fichinterstatic->id=$obj->rowid;
|
||||
$fichinterstatic->ref=$obj->ref;
|
||||
$fichinterstatic->statut=$obj->fk_statut;
|
||||
|
||||
$companystatic->id = $obj->socid;
|
||||
$companystatic->name = $obj->name;
|
||||
$companystatic->name_alias = $obj->name_alias;
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_compta = $obj->code_compta;
|
||||
$companystatic->client = $obj->client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
$companystatic->fournisseur = $obj->fournisseur;
|
||||
$companystatic->logo = $obj->logo;
|
||||
$companystatic->email = $obj->email;
|
||||
$companystatic->entity = $obj->entity;
|
||||
$companystatic->canvas = $obj->canvas;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowFichinter"), "intervention").' '.$obj->ref."</a></td>";
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"), "company").' '.dol_trunc($obj->name, 24).'</a></td></tr>';
|
||||
print '<td class="nowrap tdoverflowmax100">';
|
||||
print $fichinterstatic->getNomUrl(1);
|
||||
print "</td>";
|
||||
print '<td class="nowrap tdoverflowmax100">';
|
||||
print $companystatic->getNomUrl(1, 'customer');
|
||||
print '</td></tr>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ if ($action == 'create') {
|
||||
print '<div style="padding-top: 10px">';
|
||||
// wysiwyg editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
|
||||
$doleditor->Create();
|
||||
print '</div>';
|
||||
|
||||
@ -1273,7 +1273,7 @@ if ($action == 'create') {
|
||||
if ($action == 'edit') {
|
||||
// wysiwyg editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor = new DolEditor('bodyemail', $object->body, '', 600, 'dolibarr_mailings', '', true, true, getDolGlobalInt('FCKEDITOR_ENABLE_MAILING'), 20, '90%');
|
||||
$doleditor->Create();
|
||||
}
|
||||
if ($action == 'edithtml') {
|
||||
|
||||
@ -384,6 +384,7 @@ if ($object->fetch($id) >= 0) {
|
||||
if ($allowaddtarget) {
|
||||
print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&token='.newToken().'&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="page_y" value="'.newToken().'">';
|
||||
} else {
|
||||
print '<div '.$bctag[$var].'>';
|
||||
}
|
||||
@ -428,7 +429,7 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
print '<div class="tagtd right">';
|
||||
if ($allowaddtarget) {
|
||||
print '<input type="submit" class="button button-add small" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button button-add small reposition" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
} else {
|
||||
print '<input type="submit" class="button small disabled" disabled="disabled" name="button_'.$modulename.'" value="'.$langs->trans("Add").'">';
|
||||
//print $langs->trans("MailNoChangePossible");
|
||||
|
||||
@ -2264,8 +2264,8 @@ class Commande extends CommonOrder
|
||||
}
|
||||
$sql .= ' ed.fk_origin_line = cd.rowid';
|
||||
$sql .= ' AND cd.fk_commande = '.((int) $this->id);
|
||||
if ($this->fk_product > 0) {
|
||||
$sql .= ' AND cd.fk_product = '.((int) $this->fk_product);
|
||||
if ($fk_product > 0) {
|
||||
$sql .= ' AND cd.fk_product = '.((int) $fk_product);
|
||||
}
|
||||
if ($filtre_statut >= 0) {
|
||||
$sql .= ' AND e.fk_statut >= '.((int) $filtre_statut);
|
||||
|
||||
@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="linkedcol-ref">'.$objectlink->ref_client.'</td>';
|
||||
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
echo '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
|
||||
@ -986,7 +986,7 @@ if ($action == 'create') {
|
||||
print '<td>';
|
||||
// Editor wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_4, '95%');
|
||||
$doleditor = new DolEditor('account_comment', (GETPOST("account_comment") ?GETPOST("account_comment") : $object->comment), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_4, '95%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "banks", "bills", "accountancy"));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid", "int");
|
||||
if ($user->socid) {
|
||||
@ -75,6 +77,7 @@ if (empty($search_datev_start)) {
|
||||
if (empty($search_datev_end)) {
|
||||
$search_datev_end = GETPOST("search_datev_end", 'int');
|
||||
}
|
||||
$search_type_id = GETPOST('search_type_id', 'int');
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
@ -94,19 +97,6 @@ if (!$sortorder) {
|
||||
|
||||
$filtre = GETPOST("filtre", 'alpha');
|
||||
|
||||
if (!GETPOST('typeid')) {
|
||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
||||
$filterarray = explode('-', $newfiltre);
|
||||
foreach ($filterarray as $val) {
|
||||
$part = explode(':', $val);
|
||||
if ($part[0] == 'v.fk_typepayment') {
|
||||
$typeid = $part[1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$typeid = GETPOST('typeid');
|
||||
}
|
||||
|
||||
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 = '';
|
||||
@ -120,7 +110,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
||||
$search_bank_entry = '';
|
||||
$search_accountancy_account = '';
|
||||
$search_accountancy_subledger = '';
|
||||
$typeid = '';
|
||||
$search_type_id = '';
|
||||
}
|
||||
|
||||
$search_all = GETPOSTISSET("search_all") ? trim(GETPOST("search_all", 'alpha')) : trim(GETPOST('sall'));
|
||||
@ -265,8 +255,8 @@ if ($search_accountancy_account > 0) {
|
||||
if ($search_accountancy_subledger > 0) {
|
||||
$sql .= " AND v.subledger_account = ".((int) $search_accountancy_subledger);
|
||||
}
|
||||
if ($typeid > 0) {
|
||||
$sql .= " AND v.fk_typepayment=".((int) $typeid);
|
||||
if ($search_type_id > 0) {
|
||||
$sql .= " AND v.fk_typepayment=".((int) $search_type_id);
|
||||
}
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
@ -324,8 +314,8 @@ if ($resql) {
|
||||
if ($search_datev_end) {
|
||||
$param .= '&search_datev_end='.urlencode($search_datev_end);
|
||||
}
|
||||
if ($typeid > 0) {
|
||||
$param .= '&typeid='.urlencode($typeid);
|
||||
if ($search_type_id > 0) {
|
||||
$param .= '&search_type_id='.urlencode($search_type_id);
|
||||
}
|
||||
if ($search_amount_deb) {
|
||||
$param .= '&search_amount_deb='.urlencode($search_amount_deb);
|
||||
@ -375,6 +365,7 @@ if ($resql) {
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$moreforfilter= '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
||||
@ -427,7 +418,7 @@ if ($resql) {
|
||||
// Payment type
|
||||
if ($arrayfields['type']['checked']) {
|
||||
print '<td class="liste_titre center">';
|
||||
$form->select_types_paiements($typeid, 'typeid', '', 0, 1, 1, 16, 1, 'maxwidth100');
|
||||
$form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, 1, 16, 1, 'maxwidth100');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -544,6 +535,8 @@ if ($resql) {
|
||||
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val']['total_cred'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -656,7 +649,7 @@ if ($resql) {
|
||||
if ($arrayfields['account']['checked']) {
|
||||
$accountingaccount->fetch('', $obj->accountancy_code, 1);
|
||||
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.' '.$obj->accountancy_label).'">'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->accountancy_code.' '.$accountingaccount->label).'">'.$accountingaccount->getNomUrl(0, 1, 1, '', 1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -58,6 +58,7 @@ $filtre = GETPOST("filtre", 'alpha');
|
||||
if (!$year) {
|
||||
$year = date("Y", time());
|
||||
}
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
|
||||
@ -184,7 +185,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
$totalnb = 0;
|
||||
$totalpaid = 0;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
@ -204,7 +204,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
print $socialcontrib->getNomUrl(1, '20');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/compta/sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->label.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
|
||||
// Ref payment
|
||||
@ -246,7 +246,6 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaid = $totalpaid + $obj->totalpaid;
|
||||
$i++;
|
||||
}
|
||||
@ -274,7 +273,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
|
||||
print load_fiche_titre($langs->trans("VATDeclarations").($year ? ' ('.$langs->trans("Year").' '.$year.')' : ''), '', '');
|
||||
|
||||
$sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank,";
|
||||
$sql = "SELECT ptva.rowid, pv.rowid as id_tva, pv.amount as amount_tva, ptva.amount, pv.label, pv.datev as dm, ptva.datep as date_payment, ptva.fk_bank, ptva.num_paiement as num_payment,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
||||
|
||||
@ -256,7 +256,7 @@ $arrayfields = array(
|
||||
'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
||||
);
|
||||
|
||||
if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RETAINED_WARRANTY) {
|
||||
if (getDolGlobalString("INVOICE_USE_SITUATION") && !empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) {
|
||||
$arrayfields['f.retained_warranty'] = array('label'=>$langs->trans("RetainedWarranty"), 'checked'=>0, 'position'=>86);
|
||||
}
|
||||
// Overwrite $arrayfields from columns into ->fields (transition before removal of $arrayoffields)
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@ -254,6 +255,7 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
|
||||
$total = 0;
|
||||
$total_ttc = 0;
|
||||
$totalrecu = 0;
|
||||
|
||||
while ($i < $num) {
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@ -134,7 +135,7 @@ print '<tr><td>'.$langs->trans('Mode').'</td><td colspan="3">'.$langs->trans("Pa
|
||||
print '<tr><td>'.$langs->trans('Numero').'</td><td colspan="3">'.$object->num_payment.'</td></tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
|
||||
// Note
|
||||
print '<tr><td>'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($object->note).'</td></tr>';
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -53,6 +53,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@ -544,7 +545,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
*/
|
||||
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
// Clean data
|
||||
$this->num_payment = trim($this->num_payment);
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* 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
|
||||
@ -41,16 +41,17 @@ if (!empty($conf->project->enabled)) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('compta', 'banks', 'bills', 'hrm', 'projects'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sclist';
|
||||
|
||||
$search_ref = GETPOST('search_ref', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'int');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_typeid = GETPOST('search_typeid', 'int');
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
@ -70,11 +71,11 @@ $search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $se
|
||||
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
||||
$search_users = GETPOST('search_users');
|
||||
$search_type = GETPOST('search_type', 'int');
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
||||
if (empty($page) || $page == -1) {
|
||||
@ -93,19 +94,6 @@ if (!$sortorder) {
|
||||
|
||||
$filtre = GETPOST("filtre", 'int');
|
||||
|
||||
if (!GETPOSTISSET('search_typeid')) {
|
||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
||||
$filterarray = explode('-', $newfiltre);
|
||||
foreach ($filterarray as $val) {
|
||||
$part = explode(':', $val);
|
||||
if ($part[0] == 'cs.fk_type') {
|
||||
$search_typeid = $part[1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$search_typeid = GETPOST('search_typeid', 'int');
|
||||
}
|
||||
|
||||
$arrayfields = array(
|
||||
'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
|
||||
'cs.libelle' =>array('label'=>"Label", 'checked'=>1, 'position'=>20),
|
||||
@ -388,6 +376,9 @@ if (empty($mysoc->country_id) && empty($mysoc->country_code)) {
|
||||
$db->close();
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
$massactionbutton = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) {
|
||||
@ -551,7 +542,9 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], '', '', '', '', $
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
$totalarray = $TLoadedUsers = array();
|
||||
$totalarray = $TLoadedUsers = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val']['totalttcfield'] = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -37,6 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
$hookmanager = new HookManager($db);
|
||||
|
||||
@ -48,6 +51,7 @@ $langs->loadLangs(array('compta', 'bills', 'hrm'));
|
||||
|
||||
$year = GETPOST("year", 'int');
|
||||
$search_sc_type = GETPOST('search_sc_type', 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -123,6 +127,9 @@ if ($year) {
|
||||
if ($search_sc_type) {
|
||||
$param .= '&search_sc_type='.urlencode($search_sc_type);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
$num = 0;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
@ -139,14 +146,16 @@ $sql = "SELECT c.id, c.libelle as type_label,";
|
||||
$sql .= " cs.rowid, cs.libelle as label_sc, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total, cs.paye,";
|
||||
$sql .= " pc.rowid as pid, pc.datep, pc.amount as totalpaid, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||
$sql .= " pct.code as payment_code,";
|
||||
$sql .= " u.rowid uid, u.lastname, u.firstname, u.email, u.login, u.admin,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos";
|
||||
$sql .= " u.rowid as uid, u.lastname, u.firstname, u.email, u.login, u.admin, u.statut,";
|
||||
$sql .= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,";
|
||||
$sql .= " aj.label as account_journal";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pct ON pc.fk_typepaiement = pct.id";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pc.fk_bank = b.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON ba.fk_accountancy_journal = aj.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = cs.fk_user";
|
||||
$sql .= " WHERE cs.fk_type = c.id";
|
||||
$sql .= " AND cs.entity IN (".getEntity("tax").")";
|
||||
@ -278,7 +287,7 @@ while ($i < min($num, $limit)) {
|
||||
print $socialcontrib->getNomUrl(1, '');
|
||||
print '</td>';
|
||||
// Type
|
||||
print '<td title="'.dol_escape_htmltag($obj->label).'" class="tdoverflowmax300">'.$obj->label.'</td>';
|
||||
print '<td title="'.dol_escape_htmltag($obj->label_sc).'" class="tdoverflowmax300">'.$obj->label_sc.'</td>';
|
||||
// Date
|
||||
$date = $obj->periode;
|
||||
if (empty($date)) {
|
||||
@ -297,8 +306,7 @@ while ($i < min($num, $limit)) {
|
||||
$userstatic->admin = $obj->admin;
|
||||
$userstatic->login = $obj->login;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->socid = $obj->fk_soc;
|
||||
$userstatic->statut = $obj->status;
|
||||
$userstatic->statut = $obj->statut;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
}
|
||||
@ -327,13 +335,16 @@ while ($i < min($num, $limit)) {
|
||||
$accountstatic->id = $obj->bid;
|
||||
$accountstatic->ref = $obj->bref;
|
||||
$accountstatic->number = $obj->bnumber;
|
||||
$accountstatic->accountancy_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->accountancy_journal;
|
||||
$accountstatic->label = $obj->blabel;
|
||||
$accountstatic->iban = $obj->iban;
|
||||
$accountstatic->bic = $obj->bic;
|
||||
$accountstatic->currency_code = $langs->trans("Currency".$obj->currency_code);
|
||||
$accountstatic->clos = $obj->clos;
|
||||
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
$accountstatic->account_number = $obj->account_number;
|
||||
$accountstatic->accountancy_journal = $obj->account_journal;
|
||||
}
|
||||
print $accountstatic->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
@ -356,7 +367,6 @@ while ($i < min($num, $limit)) {
|
||||
print '</tr>';
|
||||
|
||||
$total = $total + $obj->total;
|
||||
$totalnb = $totalnb + $obj->nb;
|
||||
$totalpaid = $totalpaid + $obj->totalpaid;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -1415,7 +1415,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
|
||||
$arrayothercontracts = $object->getListOfContracts('others');
|
||||
$arrayothercontracts = $object->getListOfContracts('others'); // array or -1 if technical error
|
||||
|
||||
/*
|
||||
* Lines of contracts
|
||||
@ -1544,9 +1544,9 @@ if ($action == 'create') {
|
||||
print '<td class="right nowraponall">'.price($objp->pa_ht).'</td>';
|
||||
}
|
||||
|
||||
// Icon move, update et delete (statut contrat 0=brouillon,1=valide,2=ferme)
|
||||
// Icon move, update et delete (status contract 0=draft,1=validated,2=closed)
|
||||
print '<td class="nowraponall right">';
|
||||
if ($user->rights->contrat->creer && count($arrayothercontracts) && ($object->statut >= 0)) {
|
||||
if ($user->rights->contrat->creer && is_array($arrayothercontracts) && count($arrayothercontracts) && ($object->statut >= 0)) {
|
||||
print '<!-- link to move service line into another contract -->';
|
||||
print '<a class="reposition marginrightonly" style="padding-left: 5px;" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=move&token='.newToken().'&rowid='.$objp->rowid.'">';
|
||||
print img_picto($langs->trans("MoveToAnotherContract"), 'uparrow');
|
||||
|
||||
@ -2126,7 +2126,7 @@ class Contrat extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of other contracts for same company than current contract
|
||||
* Return list of other contracts for the same company than current contract
|
||||
*
|
||||
* @param string $option 'all' or 'others'
|
||||
* @param array $status sort contracts having these status
|
||||
@ -2138,7 +2138,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
$tab = array();
|
||||
|
||||
$sql = "SELECT c.rowid, c.ref";
|
||||
$sql = "SELECT c.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c";
|
||||
if (!empty($product_categories)) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON cd.fk_contrat = c.rowid";
|
||||
@ -2159,12 +2159,12 @@ class Contrat extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$contrat = new Contrat($this->db);
|
||||
$contrat->fetch($obj->rowid);
|
||||
$tab[] = $contrat;
|
||||
$tab[$contrat->id] = $contrat;
|
||||
$i++;
|
||||
}
|
||||
return $tab;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1055,6 +1055,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
|
||||
if (in_array($objecttmp->element, array('societe', 'member'))) {
|
||||
$result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
} elseif (in_array($objecttmp->element, array('action'))) {
|
||||
$result = $objecttmp->delete();
|
||||
} else {
|
||||
$result = $objecttmp->delete($user);
|
||||
}
|
||||
|
||||
@ -4749,7 +4749,7 @@ class Form
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
$nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty);
|
||||
if ($nbaccountfound > 0) {
|
||||
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button smallpaddingimp valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
}
|
||||
print '</form>';
|
||||
} else {
|
||||
@ -4901,9 +4901,11 @@ class Form
|
||||
* @param int|string $height Force height of box (0 = auto)
|
||||
* @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones.
|
||||
* @param int $disableformtag 1=Disable form tag. Can be used if we are already inside a <form> section.
|
||||
* @param string $labelbuttonyes Label for Yes
|
||||
* @param string $labelbuttonno Label for No
|
||||
* @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form
|
||||
*/
|
||||
public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0)
|
||||
public function formconfirm($page, $title, $question, $action, $formquestion = '', $selectedchoice = '', $useajax = 0, $height = 0, $width = 500, $disableformtag = 0, $labelbuttonyes = 'Yes', $labelbuttonno = 'No')
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
@ -5012,7 +5014,7 @@ class Form
|
||||
$more .= ' checked="checked"';
|
||||
}
|
||||
$more .= ' /> ';
|
||||
$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'">'.$selval.'</label>';
|
||||
$more .= '<label for="'.dol_escape_htmltag($input['name'].$selkey).'" class="valignmiddle">'.$selval.'</label>';
|
||||
$more .= '</div></div>'."\n";
|
||||
$i++;
|
||||
}
|
||||
@ -5118,6 +5120,7 @@ class Form
|
||||
$(this).parent().find("button.ui-button:eq(2)").focus();
|
||||
},';
|
||||
}
|
||||
|
||||
$formconfirm .= '
|
||||
resizable: false,
|
||||
height: "'.$height.'",
|
||||
@ -5125,7 +5128,7 @@ class Form
|
||||
modal: true,
|
||||
closeOnEscape: false,
|
||||
buttons: {
|
||||
"'.dol_escape_js($langs->transnoentities("Yes")).'": function() {
|
||||
"'.dol_escape_js($langs->transnoentities($labelbuttonyes)).'": function() {
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputok = '.json_encode($inputok).'; /* List of fields into form */
|
||||
var pageyes = "'.dol_escape_js(!empty($pageyes) ? $pageyes : '').'";
|
||||
@ -5148,7 +5151,7 @@ class Form
|
||||
if (pageyes.length > 0) { location.href = urljump; }
|
||||
$(this).dialog("close");
|
||||
},
|
||||
"'.dol_escape_js($langs->transnoentities("No")).'": function() {
|
||||
"'.dol_escape_js($langs->transnoentities($labelbuttonno)).'": function() {
|
||||
var options = "&token='.urlencode(newToken()).'";
|
||||
var inputko = '.json_encode($inputko).'; /* List of fields into form */
|
||||
var pageno="'.dol_escape_js(!empty($pageno) ? $pageno : '').'";
|
||||
@ -5213,7 +5216,7 @@ class Form
|
||||
$formconfirm .= '<tr class="valid">';
|
||||
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
||||
$formconfirm .= '<td class="valid center">';
|
||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly', $labelbuttonyes, $labelbuttonno);
|
||||
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
|
||||
$formconfirm .= '</td>';
|
||||
$formconfirm .= '</tr>'."\n";
|
||||
@ -8844,9 +8847,11 @@ class Form
|
||||
* @param int $useempty 1=Add empty line
|
||||
* @param int $addjscombo 1=Add js beautifier on combo box
|
||||
* @param string $morecss More CSS
|
||||
* @return string See option
|
||||
* @param string $labelyes Label for Yes
|
||||
* @param string $labelno Label for No
|
||||
* @return string See option
|
||||
*/
|
||||
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '')
|
||||
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '', $labelyes = 'Yes', $labelno = 'No')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -8857,6 +8862,7 @@ class Form
|
||||
$no = "0";
|
||||
}
|
||||
|
||||
|
||||
$disabled = ($disabled ? ' disabled' : '');
|
||||
|
||||
$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
|
||||
@ -8864,12 +8870,12 @@ class Form
|
||||
$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'> </option>'."\n";
|
||||
}
|
||||
if (("$value" == 'yes') || ($value == 1)) {
|
||||
$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans("Yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'">'.$langs->trans("No").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'" selected>'.$langs->trans($labelyes).'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'">'.$langs->trans($labelno).'</option>'."\n";
|
||||
} else {
|
||||
$selected = (($useempty && $value != '0' && $value != 'no') ? '' : ' selected');
|
||||
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans("Yes").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans("No").'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$yes.'">'.$langs->trans($labelyes).'</option>'."\n";
|
||||
$resultyesno .= '<option value="'.$no.'"'.$selected.'>'.$langs->trans($labelno).'</option>'."\n";
|
||||
}
|
||||
$resultyesno .= '</select>'."\n";
|
||||
|
||||
|
||||
@ -700,11 +700,14 @@ class FormOther
|
||||
print ' selected';
|
||||
}
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
$labeltoshow = $lines[$i]->projectref;
|
||||
//$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
if (empty($lines[$i]->public)) {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow;
|
||||
} else {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow;
|
||||
}
|
||||
|
||||
print ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
|
||||
@ -738,12 +741,14 @@ class FormOther
|
||||
print ' disabled';
|
||||
}
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
$labeltoshow = $lines[$i]->projectref;
|
||||
//$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
if (empty($lines[$i]->public)) {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'project', 'class="pictofixedwidth"').$labeltoshow;
|
||||
} else {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
//$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
$labeltoshow = img_picto($lines[$i]->projectlabel, 'projectpub', 'class="pictofixedwidth"').$labeltoshow;
|
||||
}
|
||||
if ($lines[$i]->id) {
|
||||
$labeltoshow .= ' > ';
|
||||
|
||||
@ -418,7 +418,7 @@ class FormTicket
|
||||
}
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$uselocalbrowser = true;
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_TICKET, ROWS_8, '90%');
|
||||
$doleditor = new DolEditor('message', $msg, '100%', 230, $toolbarname, 'In', true, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_TICKET'), ROWS_8, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1475,7 +1475,7 @@ class FormTicket
|
||||
print '</td><td>';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('mail_intro', $mail_intro, '100%', 90, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
@ -1512,7 +1512,7 @@ class FormTicket
|
||||
//$toolbarname = 'dolibarr_details';
|
||||
$toolbarname = 'dolibarr_notes';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_5, 70);
|
||||
$doleditor = new DolEditor('message', $defaultmessage, '100%', 200, $toolbarname, '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_5, 70);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1524,7 +1524,7 @@ class FormTicket
|
||||
print $form->textwithpicto('', $langs->trans("TicketMessageMailSignatureHelp"), 1, 'help');
|
||||
print '</td><td>';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_2, 70);
|
||||
$doleditor = new DolEditor('mail_signature', $mail_signature, '100%', 150, 'dolibarr_details', '', false, $uselocalbrowser, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_2, 70);
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -745,7 +745,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
||||
// - posted value not empty, or
|
||||
// - if posted value is empty and a default value exists that is not empty (it means we did a filter to an empty value when default was not).
|
||||
|
||||
if ($out != '') { // $out = '0' or 'abc', it is a search criteria to keep
|
||||
if ($out != '' && isset($user)) {// $out = '0' or 'abc', it is a search criteria to keep
|
||||
$user->lastsearch_values_tmp[$relativepathstring][$paramname] = $out;
|
||||
}
|
||||
}
|
||||
@ -3917,7 +3917,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'recurring',
|
||||
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'world', 'private',
|
||||
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$fakey = $pictowithouttext;
|
||||
@ -3968,7 +3968,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
);
|
||||
if ($pictowithouttext == 'off') {
|
||||
|
||||
@ -650,7 +650,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
|
||||
if ($showproject) {
|
||||
// Project ref
|
||||
print "<td>";
|
||||
print '<td class="nowraponall">';
|
||||
//if ($showlineingray) print '<i>';
|
||||
if ($lines[$i]->public || in_array($lines[$i]->fk_project, $projectsArrayId) || !empty($user->rights->projet->all->lire)) {
|
||||
print $projectstatic->getNomUrl(1);
|
||||
@ -701,21 +701,21 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.description']['checked'])) {
|
||||
print "<td>";
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($lines[$i]->description).'">';
|
||||
print $lines[$i]->description;
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
// Date start
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.dateo']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($lines[$i]->date_start, 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Date end
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print dol_print_date($lines[$i]->date_end, 'dayhour');
|
||||
if ($taskstatic->hasDelay()) {
|
||||
print img_warning($langs->trans("Late"));
|
||||
@ -2549,8 +2549,8 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
$projectstatic->ref = $objp->ref;
|
||||
$projectstatic->status = $objp->status;
|
||||
$projectstatic->title = $objp->title;
|
||||
$projectstatic->datee = $db->jdate($objp->datee);
|
||||
$projectstatic->dateo = $db->jdate($objp->dateo);
|
||||
$projectstatic->date_end = $db->jdate($objp->datee);
|
||||
$projectstatic->date_start = $db->jdate($objp->dateo);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
||||
$tooltip .= $langs->trans("GenericMaskCodes5");
|
||||
|
||||
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskexpedition" value="'.$conf->global->EXPEDITION_RIBERA_MASK.'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskexpedition" value="'.getDolGlobalString('EXPEDITION_RIBERA_MASK').'">', $tooltip, 1, 1).'</td>';
|
||||
$texte .= '<td class="left" rowspan="2"> <input type="submit" class="button button-edit" name="Button" value="'.$langs->trans("Modify").'"></td>';
|
||||
$texte .= '</tr>';
|
||||
$texte .= '</table>';
|
||||
@ -125,9 +125,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$mask = $conf->global->EXPEDITION_RIBERA_MASK;
|
||||
$mask = getDolGlobalString('EXPEDITION_RIBERA_MASK');
|
||||
|
||||
if (!$mask) {
|
||||
if (empty($mask)) {
|
||||
$this->error = 'NotConfigured';
|
||||
return 0;
|
||||
}
|
||||
|
||||
542
htdocs/core/modules/modWebhook.class.php
Normal file
542
htdocs/core/modules/modWebhook.class.php
Normal file
@ -0,0 +1,542 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 SuperAdmin <test@dolibarr.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \defgroup webhook Module Webhook
|
||||
* \brief Webhook module descriptor.
|
||||
*
|
||||
* \file htdocs/webhook/core/modules/modWebhook.class.php
|
||||
* \ingroup webhook
|
||||
* \brief Description and activation file for module Webhook
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
||||
|
||||
/**
|
||||
* Description and activation class for module Webhook
|
||||
*/
|
||||
class modWebhook extends DolibarrModules
|
||||
{
|
||||
/**
|
||||
* Constructor. Define names, constants, directories, boxes, permissions
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $langs, $conf;
|
||||
$this->db = $db;
|
||||
|
||||
// Id for module (must be unique).
|
||||
// Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id).
|
||||
$this->numero = 68305; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve an id number for your module
|
||||
|
||||
// Key text used to identify module (for permissions, menus, etc...)
|
||||
$this->rights_class = 'webhook';
|
||||
|
||||
// Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...'
|
||||
// It is used to group modules by family in module setup page
|
||||
$this->family = "interface";
|
||||
|
||||
// Module position in the family on 2 digits ('01', '10', '20', ...)
|
||||
$this->module_position = '90';
|
||||
|
||||
// Gives the possibility for the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this)
|
||||
//$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily")));
|
||||
// Module label (no space allowed), used if translation string 'ModuleWebhookName' not found (Webhook is name of module).
|
||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||
|
||||
// Module description, used if translation string 'ModuleWebhookDesc' not found (Webhook is name of module).
|
||||
$this->description = "WebhookDescription";
|
||||
// Used only if file README.md and README-LL.md not found.
|
||||
$this->descriptionlong = "WebhookDescription";
|
||||
|
||||
// Author
|
||||
$this->editor_name = 'Editor name';
|
||||
$this->editor_url = 'https://www.example.com';
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
|
||||
$this->version = 'development';
|
||||
// Url to the file with your last numberversion of this module
|
||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||
|
||||
// Key used in llx_const table to save module status enabled/disabled (where WEBHOOK is value of property name of module in uppercase)
|
||||
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
|
||||
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
// To use a supported fa-xxx css style of font awesome, use this->picto='xxx'
|
||||
$this->picto = 'webhook';
|
||||
|
||||
// Define some features supported by module (triggers, login, substitutions, menus, css, etc...)
|
||||
$this->module_parts = array(
|
||||
// Set this to 1 if module has its own trigger directory (core/triggers)
|
||||
'triggers' => 1,
|
||||
// Set this to 1 if module has its own login method file (core/login)
|
||||
'login' => 0,
|
||||
// Set this to 1 if module has its own substitution function file (core/substitutions)
|
||||
'substitutions' => 0,
|
||||
// Set this to 1 if module has its own menus handler directory (core/menus)
|
||||
'menus' => 0,
|
||||
// Set this to 1 if module overwrite template dir (core/tpl)
|
||||
'tpl' => 0,
|
||||
// Set this to 1 if module has its own barcode directory (core/modules/barcode)
|
||||
'barcode' => 0,
|
||||
// Set this to 1 if module has its own models directory (core/modules/xxx)
|
||||
'models' => 1,
|
||||
// Set this to 1 if module has its own printing directory (core/modules/printing)
|
||||
'printing' => 0,
|
||||
// Set this to 1 if module has its own theme directory (theme)
|
||||
'theme' => 0,
|
||||
// Set this to relative path of css file if module has its own css file
|
||||
'css' => array(
|
||||
// '/webhook/css/webhook.css.php',
|
||||
),
|
||||
// Set this to relative path of js file if module must load a js on all pages
|
||||
'js' => array(
|
||||
// '/webhook/js/webhook.js.php',
|
||||
),
|
||||
// Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context to 'all'
|
||||
'hooks' => array(
|
||||
// 'data' => array(
|
||||
// 'hookcontext1',
|
||||
// 'hookcontext2',
|
||||
// ),
|
||||
// 'entity' => '0',
|
||||
),
|
||||
// Set this to 1 if features of module are opened to external users
|
||||
'moduleforexternal' => 0,
|
||||
);
|
||||
|
||||
// Data directories to create when module is enabled.
|
||||
// Example: this->dirs = array("/webhook/temp","/webhook/subdir");
|
||||
$this->dirs = array("/webhook/temp");
|
||||
|
||||
// Config pages. Put here list of php page, stored into webhook/admin directory, to use to setup module.
|
||||
$this->config_page_url = array("webhook.php");
|
||||
|
||||
// Dependencies
|
||||
// A condition to hide module
|
||||
$this->hidden = false;
|
||||
// List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...)
|
||||
$this->depends = array();
|
||||
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
|
||||
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
|
||||
|
||||
// The language file dedicated to your module
|
||||
$this->langfiles = array("webhook");
|
||||
|
||||
// Prerequisites
|
||||
$this->phpmin = array(5, 6); // Minimum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
|
||||
|
||||
// Messages at activation
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','MX'='textmx'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','MX'='textmx'...)
|
||||
//$this->automatic_activation = array('FR'=>'WebhookWasAutomaticallyActivatedBecauseOfYourCountryChoice');
|
||||
//$this->always_enabled = true; // If true, can't be disabled
|
||||
|
||||
// Constants
|
||||
// List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive)
|
||||
// Example: $this->const=array(1 => array('WEBHOOK_MYNEWCONST1', 'chaine', 'myvalue', 'This is a constant to add', 1),
|
||||
// 2 => array('WEBHOOK_MYNEWCONST2', 'chaine', 'myvalue', 'This is another constant to add', 0, 'current', 1)
|
||||
// );
|
||||
$this->const = array();
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
/*$this->overwrite_translation = array(
|
||||
'en_US:ParentCompany'=>'Parent company or reseller',
|
||||
'fr_FR:ParentCompany'=>'Maison mère ou revendeur'
|
||||
)*/
|
||||
|
||||
if (!isset($conf->webhook) || !isset($conf->webhook->enabled)) {
|
||||
$conf->webhook = new stdClass();
|
||||
$conf->webhook->enabled = 0;
|
||||
}
|
||||
|
||||
// Array to add new pages in new tabs
|
||||
$this->tabs = array();
|
||||
// Example:
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@webhook:$user->rights->webhook->read:/webhook/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@webhook:$user->rights->othermodule->read:/webhook/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname
|
||||
//
|
||||
// Where objecttype can be
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
// 'contact' to add a tab in contact view
|
||||
// 'contract' to add a tab in contract view
|
||||
// 'group' to add a tab in group view
|
||||
// 'intervention' to add a tab in intervention view
|
||||
// 'invoice' to add a tab in customer invoice view
|
||||
// 'invoice_supplier' to add a tab in supplier invoice view
|
||||
// 'member' to add a tab in fundation member view
|
||||
// 'opensurveypoll' to add a tab in opensurvey poll view
|
||||
// 'order' to add a tab in customer order view
|
||||
// 'order_supplier' to add a tab in supplier order view
|
||||
// 'payment' to add a tab in payment view
|
||||
// 'payment_supplier' to add a tab in supplier payment view
|
||||
// 'product' to add a tab in product view
|
||||
// 'propal' to add a tab in propal view
|
||||
// 'project' to add a tab in project view
|
||||
// 'stock' to add a tab in stock view
|
||||
// 'thirdparty' to add a tab in third party view
|
||||
// 'user' to add a tab in user view
|
||||
|
||||
// Dictionaries
|
||||
$this->dictionaries = array();
|
||||
/* Example:
|
||||
$this->dictionaries=array(
|
||||
'langs'=>'webhook@webhook',
|
||||
// List of tables we want to see into dictonnary editor
|
||||
'tabname'=>array(MAIN_DB_PREFIX."table1", MAIN_DB_PREFIX."table2", MAIN_DB_PREFIX."table3"),
|
||||
// Label of tables
|
||||
'tablib'=>array("Table1", "Table2", "Table3"),
|
||||
// Request to select fields
|
||||
'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
|
||||
// Sort order
|
||||
'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"),
|
||||
// List of fields (result of select to show dictionary)
|
||||
'tabfield'=>array("code,label", "code,label", "code,label"),
|
||||
// List of fields (list of fields to edit a record)
|
||||
'tabfieldvalue'=>array("code,label", "code,label", "code,label"),
|
||||
// List of fields (list of fields for insert)
|
||||
'tabfieldinsert'=>array("code,label", "code,label", "code,label"),
|
||||
// Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabrowid'=>array("rowid", "rowid", "rowid"),
|
||||
// Condition to show each dictionary
|
||||
'tabcond'=>array($conf->webhook->enabled, $conf->webhook->enabled, $conf->webhook->enabled)
|
||||
);
|
||||
*/
|
||||
|
||||
// Boxes/Widgets
|
||||
// Add here list of php file(s) stored in webhook/core/boxes that contains a class to show a widget.
|
||||
$this->boxes = array(
|
||||
// 0 => array(
|
||||
// 'file' => 'webhookwidget1.php@webhook',
|
||||
// 'note' => 'Widget provided by Webhook',
|
||||
// 'enabledbydefaulton' => 'Home',
|
||||
// ),
|
||||
// ...
|
||||
);
|
||||
|
||||
// Cronjobs (List of cron jobs entries to add when module is enabled)
|
||||
// unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week
|
||||
$this->cronjobs = array(
|
||||
// 0 => array(
|
||||
// 'label' => 'MyJob label',
|
||||
// 'jobtype' => 'method',
|
||||
// 'class' => '/webhook/class/webhook_target.class.php',
|
||||
// 'objectname' => 'Webhook_target',
|
||||
// 'method' => 'doScheduledJob',
|
||||
// 'parameters' => '',
|
||||
// 'comment' => 'Comment',
|
||||
// 'frequency' => 2,
|
||||
// 'unitfrequency' => 3600,
|
||||
// 'status' => 0,
|
||||
// 'test' => '$conf->webhook->enabled',
|
||||
// 'priority' => 50,
|
||||
// ),
|
||||
);
|
||||
// Example: $this->cronjobs=array(
|
||||
// 0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>'$conf->webhook->enabled', 'priority'=>50),
|
||||
// 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>'$conf->webhook->enabled', 'priority'=>50)
|
||||
// );
|
||||
|
||||
// Permissions provided by this module
|
||||
$this->rights = array();
|
||||
$r = 0;
|
||||
// Add here entries to declare new permissions
|
||||
/* BEGIN MODULEBUILDER PERMISSIONS */
|
||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Read objects of Webhook'; // Permission label
|
||||
$this->rights[$r][4] = 'webhook_target';
|
||||
$this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->read)
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Create/Update objects of Webhook'; // Permission label
|
||||
$this->rights[$r][4] = 'webhook_target';
|
||||
$this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->write)
|
||||
$r++;
|
||||
$this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used)
|
||||
$this->rights[$r][1] = 'Delete objects of Webhook'; // Permission label
|
||||
$this->rights[$r][4] = 'webhook_target';
|
||||
$this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->webhook->webhook_target->delete)
|
||||
$r++;
|
||||
/* END MODULEBUILDER PERMISSIONS */
|
||||
|
||||
// Main menu entries to add
|
||||
$this->menu = array();
|
||||
$r = 0;
|
||||
// Add here entries to declare new menus
|
||||
/* BEGIN MODULEBUILDER TOPMENU */
|
||||
/*$this->menu[$r++] = array(
|
||||
'fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'top', // This is a Top menu entry
|
||||
'titre'=>'ModuleWebhookName',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'',
|
||||
'url'=>'/webhook/webhookindex.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000 + $r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'1', // Use 'perms'=>'$user->rights->webhook->webhook_target->read' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);*/
|
||||
/* END MODULEBUILDER TOPMENU */
|
||||
/* BEGIN MODULEBUILDER LEFTMENU WEBHOOK_TARGET
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=webhook', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'Webhook_target',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_target',
|
||||
'url'=>'/webhook/webhookindex.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_target', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'List_Webhook_target',
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target_list',
|
||||
'url'=>'/webhook/webhook_target_list.php',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->read', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_target', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'New_Webhook_target',
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target_new',
|
||||
'url'=>'/webhook/webhook_target_card.php?action=create',
|
||||
'langs'=>'webhook@webhook', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'$conf->webhook->enabled', // Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->rights->webhook->webhook_target->write', // Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
);
|
||||
*/
|
||||
|
||||
/*$this->menu[$r++]=array(
|
||||
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'fk_menu'=>'fk_mainmenu=webhook',
|
||||
// This is a Left menu entry
|
||||
'type'=>'left',
|
||||
'titre'=>'List Webhook_target',
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target',
|
||||
'url'=>'/webhook/webhook_target_list.php',
|
||||
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'webhook@webhook',
|
||||
'position'=>1100+$r,
|
||||
// Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->webhook->enabled',
|
||||
// Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'1',
|
||||
'target'=>'',
|
||||
// 0=Menu for internal users, 1=external users, 2=both
|
||||
'user'=>2,
|
||||
);
|
||||
$this->menu[$r++]=array(
|
||||
// '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'fk_menu'=>'fk_mainmenu=webhook,fk_leftmenu=webhook_webhook_target',
|
||||
// This is a Left menu entry
|
||||
'type'=>'left',
|
||||
'titre'=>'New Webhook_target',
|
||||
'mainmenu'=>'webhook',
|
||||
'leftmenu'=>'webhook_webhook_target',
|
||||
'url'=>'/webhook/webhook_target_card.php?action=create',
|
||||
// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'langs'=>'webhook@webhook',
|
||||
'position'=>1100+$r,
|
||||
// Define condition to show or hide menu entry. Use '$conf->webhook->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'enabled'=>'$conf->webhook->enabled',
|
||||
// Use 'perms'=>'$user->rights->webhook->level1->level2' if you want your menu with a permission rules
|
||||
'perms'=>'1',
|
||||
'target'=>'',
|
||||
// 0=Menu for internal users, 1=external users, 2=both
|
||||
'user'=>2
|
||||
);*/
|
||||
|
||||
/* END MODULEBUILDER LEFTMENU WEBHOOK_TARGET */
|
||||
// Exports profiles provided by this module
|
||||
$r = 1;
|
||||
/* BEGIN MODULEBUILDER EXPORT WEBHOOK_TARGET */
|
||||
/*
|
||||
$langs->load("webhook@webhook");
|
||||
$this->export_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->export_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->export_icon[$r]='webhook_target@webhook';
|
||||
// Define $this->export_fields_array, $this->export_TypeFields_array and $this->export_entities_array
|
||||
$keyforclass = 'Webhook_target'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_target@webhook';
|
||||
include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
|
||||
//$this->export_fields_array[$r]['t.fieldtoadd']='FieldToAdd'; $this->export_TypeFields_array[$r]['t.fieldtoadd']='Text';
|
||||
//unset($this->export_fields_array[$r]['t.fieldtoremove']);
|
||||
//$keyforclass = 'Webhook_targetLine'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_targetline@webhook'; $keyforalias='tl';
|
||||
//include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php';
|
||||
$keyforselect='webhook_target'; $keyforaliasextra='extra'; $keyforelement='webhook_target@webhook';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$keyforselect='webhook_targetline'; $keyforaliasextra='extraline'; $keyforelement='webhook_targetline@webhook';
|
||||
//include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$this->export_dependencies_array[$r] = array('webhook_targetline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
|
||||
//$this->export_special_array[$r] = array('t.field'=>'...');
|
||||
//$this->export_examplevalues_array[$r] = array('t.field'=>'Example');
|
||||
//$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp');
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'webhook_target as t';
|
||||
//$this->export_sql_end[$r] =' LEFT JOIN '.MAIN_DB_PREFIX.'webhook_target_line as tl ON tl.fk_webhook_target = t.rowid';
|
||||
$this->export_sql_end[$r] .=' WHERE 1 = 1';
|
||||
$this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('webhook_target').')';
|
||||
$r++; */
|
||||
/* END MODULEBUILDER EXPORT WEBHOOK_TARGET */
|
||||
|
||||
// Imports profiles provided by this module
|
||||
$r = 1;
|
||||
/* BEGIN MODULEBUILDER IMPORT WEBHOOK_TARGET */
|
||||
/*
|
||||
$langs->load("webhook@webhook");
|
||||
$this->import_code[$r]=$this->rights_class.'_'.$r;
|
||||
$this->import_label[$r]='Webhook_targetLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
|
||||
$this->import_icon[$r]='webhook_target@webhook';
|
||||
$this->import_tables_array[$r] = array('t' => MAIN_DB_PREFIX.'webhook_webhook_target', 'extra' => MAIN_DB_PREFIX.'webhook_webhook_target_extrafields');
|
||||
$this->import_tables_creator_array[$r] = array('t' => 'fk_user_author'); // Fields to store import user id
|
||||
$import_sample = array();
|
||||
$keyforclass = 'Webhook_target'; $keyforclassfile='/webhook/class/webhook_target.class.php'; $keyforelement='webhook_target@webhook';
|
||||
include DOL_DOCUMENT_ROOT.'/core/commonfieldsinimport.inc.php';
|
||||
$import_extrafield_sample = array();
|
||||
$keyforselect='webhook_target'; $keyforaliasextra='extra'; $keyforelement='webhook_target@webhook';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinimport.inc.php';
|
||||
$this->import_fieldshidden_array[$r] = array('extra.fk_object' => 'lastrowid-'.MAIN_DB_PREFIX.'webhook_webhook_target');
|
||||
$this->import_regex_array[$r] = array();
|
||||
$this->import_examplevalues_array[$r] = array_merge($import_sample, $import_extrafield_sample);
|
||||
$this->import_updatekeys_array[$r] = array('t.ref' => 'Ref');
|
||||
$this->import_convertvalue_array[$r] = array(
|
||||
't.ref' => array(
|
||||
'rule'=>'getrefifauto',
|
||||
'class'=>(empty($conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON) ? 'mod_webhook_target_standard' : $conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON),
|
||||
'path'=>"/core/modules/commande/".(empty($conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON) ? 'mod_webhook_target_standard' : $conf->global->WEBHOOK_WEBHOOK_TARGET_ADDON).'.php'
|
||||
'classobject'=>'Webhook_target',
|
||||
'pathobject'=>'/webhook/class/webhook_target.class.php',
|
||||
),
|
||||
't.fk_soc' => array('rule' => 'fetchidfromref', 'file' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty'),
|
||||
't.fk_user_valid' => array('rule' => 'fetchidfromref', 'file' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'user'),
|
||||
't.fk_mode_reglement' => array('rule' => 'fetchidfromcodeorlabel', 'file' => '/compta/paiement/class/cpaiement.class.php', 'class' => 'Cpaiement', 'method' => 'fetch', 'element' => 'cpayment'),
|
||||
);
|
||||
$r++; */
|
||||
/* END MODULEBUILDER IMPORT WEBHOOK_TARGET */
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called when module is enabled.
|
||||
* The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database.
|
||||
* It also creates data directories
|
||||
*
|
||||
* @param string $options Options when enabling module ('', 'noboxes')
|
||||
* @return int 1 if OK, 0 if KO
|
||||
*/
|
||||
public function init($options = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$result = $this->_load_tables('/install/mysql/tables/', 'webhook');
|
||||
//$result = $this->_load_tables('/webhook/sql/');
|
||||
if ($result < 0) {
|
||||
return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default')
|
||||
}
|
||||
|
||||
// Create extrafields during init
|
||||
//include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
//$extrafields = new ExtraFields($this->db);
|
||||
//$result1=$extrafields->addExtraField('webhook_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result2=$extrafields->addExtraField('webhook_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result3=$extrafields->addExtraField('webhook_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result4=$extrafields->addExtraField('webhook_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
//$result5=$extrafields->addExtraField('webhook_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'webhook@webhook', '$conf->webhook->enabled');
|
||||
|
||||
// Permissions
|
||||
$this->remove($options);
|
||||
|
||||
$sql = array();
|
||||
|
||||
// Document templates
|
||||
$moduledir = dol_sanitizeFileName('webhook');
|
||||
$myTmpObjects = array();
|
||||
$myTmpObjects['Webhook_target'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||
|
||||
foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
||||
if ($myTmpObjectKey == 'Webhook_target') {
|
||||
continue;
|
||||
}
|
||||
if ($myTmpObjectArray['includerefgeneration']) {
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_webhook_targets.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
|
||||
$dest = $dirodt.'/template_webhook_targets.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
dol_mkdir($dirodt);
|
||||
$result = dol_copy($src, $dest, 0, 0);
|
||||
if ($result < 0) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorFailToCopyFile', $src, $dest);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = array_merge($sql, array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity),
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")",
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity),
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_init($sql, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called when module is disabled.
|
||||
* Remove from database constants, boxes and permissions from Dolibarr database.
|
||||
* Data directories are not deleted
|
||||
*
|
||||
* @param string $options Options when enabling module ('', 'noboxes')
|
||||
* @return int 1 if OK, 0 if KO
|
||||
*/
|
||||
public function remove($options = '')
|
||||
{
|
||||
$sql = array();
|
||||
return $this->_remove($sql, $options);
|
||||
}
|
||||
}
|
||||
@ -358,6 +358,10 @@ if ($nolinesbefore) {
|
||||
if (!empty($conf->service->enabled) && ($object->element == 'facturerec' || $object->element == 'invoice_supplier_rec')) {
|
||||
echo '<div class="divlinefordates"><br>';
|
||||
echo $langs->trans('AutoFillDateFrom').' ';
|
||||
if (!empty($conf->global->INVOICE_REC_DATE_TO_YES)) {
|
||||
$line->date_start_fill = 1;
|
||||
$line->date_end_fill = 1;
|
||||
}
|
||||
echo $form->selectyesno('date_start_fill', $line->date_start_fill, 1);
|
||||
echo ' - ';
|
||||
echo $langs->trans('AutoFillDateTo').' ';
|
||||
|
||||
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/* Copyright (C) 2022 SuperAdmin <test@dolibarr.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file core/triggers/interface_99_modWebhook_WebhookTriggers.class.php
|
||||
* \ingroup webhook
|
||||
* \brief Example trigger.
|
||||
*
|
||||
* Put detailed description here.
|
||||
*
|
||||
* \remarks You can create other triggers by copying this one.
|
||||
* - File name should be either:
|
||||
* - interface_99_modWebhook_MyTrigger.class.php
|
||||
* - interface_99_all_MyTrigger.class.php
|
||||
* - The file must stay in core/triggers
|
||||
* - The class name must be InterfaceMytrigger
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/webhook/class/target.class.php';
|
||||
|
||||
/**
|
||||
* Class of triggers for Webhook module
|
||||
*/
|
||||
class InterfaceWebhookTriggers extends DolibarrTriggers
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
$this->name = preg_replace('/^Interface/i', '', get_class($this));
|
||||
$this->family = "demo";
|
||||
$this->description = "Webhook triggers.";
|
||||
// 'development', 'experimental', 'dolibarr' or version
|
||||
$this->version = 'development';
|
||||
$this->picto = 'webhook@webhook';
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger name
|
||||
*
|
||||
* @return string Name of trigger file
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger description
|
||||
*
|
||||
* @return string Description of trigger file
|
||||
*/
|
||||
public function getDesc()
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "runTrigger" are triggered if file
|
||||
* is inside directory core/triggers
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param CommonObject $object Object
|
||||
* @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)
|
||||
{
|
||||
if (empty($conf->webhook) || empty($conf->webhook->enabled)) {
|
||||
return 0; // If module is not enabled, we do nothing
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
|
||||
// Or you can execute some code here
|
||||
$nbPosts = 0;
|
||||
$errors = 0;
|
||||
$static_object = new Target($this->db);
|
||||
$target_url = $static_object->fetchAll();
|
||||
foreach ($target_url as $key => $tmpobject) {
|
||||
$actionarray = explode(",", $tmpobject->trigger_codes);
|
||||
if (is_array($actionarray) && in_array($action, $actionarray)) {
|
||||
$jsonstr = '{"triggercode":'.json_encode($action).',"object":'.json_encode($object).'}';
|
||||
$response = getURLContent($tmpobject->url, 'POST', $jsonstr);
|
||||
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
|
||||
$nbPosts ++;
|
||||
} else {
|
||||
$errors ++;
|
||||
dol_syslog("Failed to get url with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""), LOG_DEBUG);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($errors)) {
|
||||
return $errors * -1;
|
||||
}
|
||||
return $nbPosts;
|
||||
}
|
||||
}
|
||||
@ -1244,7 +1244,7 @@ class Expedition extends CommonObject
|
||||
$mouvS->origin = null;
|
||||
// get lot/serial
|
||||
$lotArray = null;
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$lotArray = $shipmentlinebatch->fetchAll($obj->expeditiondet_id);
|
||||
if (!is_array($lotArray)) {
|
||||
$error++;
|
||||
@ -2781,7 +2781,7 @@ class ExpeditionLigne extends CommonObjectLine
|
||||
$this->db->begin();
|
||||
|
||||
// delete batch expedition line
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet_batch";
|
||||
$sql .= " WHERE fk_expeditiondet = ".((int) $this->id);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -138,7 +138,7 @@ $candelete = 0;
|
||||
if (!empty($user->rights->expensereport->supprimer)) {
|
||||
$candelete = 1;
|
||||
}
|
||||
if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->rights->expensereport->write && in_array($object->fk_user_author, $childids)) {
|
||||
if ($object->statut == ExpenseReport::STATUS_DRAFT && !empty($user->rights->expensereport->write) && in_array($object->fk_user_author, $childids)) {
|
||||
$candelete = 1;
|
||||
}
|
||||
|
||||
@ -1467,6 +1467,8 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Public note
|
||||
$note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : '';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td>';
|
||||
@ -1476,6 +1478,8 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
// Private note
|
||||
$note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : '';
|
||||
|
||||
if (empty($user->socid)) {
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
|
||||
@ -1624,6 +1628,8 @@ if ($action == 'create') {
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Clone confirmation
|
||||
if ($action == 'clone') {
|
||||
// Create an array for form
|
||||
@ -1923,6 +1929,7 @@ if ($action == 'create') {
|
||||
|
||||
// List of payments already done
|
||||
$nbcols = 3;
|
||||
$nbrows = 0;
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
$nbrows++;
|
||||
$nbcols++;
|
||||
|
||||
@ -1433,7 +1433,7 @@ if ($action == 'create') {
|
||||
|
||||
// Editeur wysiwyg
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('np_desc', $objp->description, '', 164, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, '90%');
|
||||
$doleditor = new DolEditor('np_desc', $objp->description, '', 164, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_DETAILS'), ROWS_2, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
$objectline = new FichinterLigne($db);
|
||||
|
||||
@ -89,7 +89,6 @@ $sql .= " GROUP BY f.fk_statut";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$total = 0;
|
||||
$totalinprocess = 0;
|
||||
@ -97,38 +96,28 @@ if ($resql) {
|
||||
$vals = array();
|
||||
$bool = false;
|
||||
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
if ($row) {
|
||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||
{
|
||||
$bool = (!empty($row[2]) ?true:false);
|
||||
if (!isset($vals[$row[1].$bool])) {
|
||||
$vals[$row[1].$bool] = 0;
|
||||
}
|
||||
$vals[$row[1].$bool] += $row[0];
|
||||
$totalinprocess += $row[0];
|
||||
if ($num>0) {
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
if (!isset($vals[$row[1]])) {
|
||||
$vals[$row[1]] = 0;
|
||||
}
|
||||
$vals[$row[1]] += $row[0];
|
||||
$totalinprocess += $row[0];
|
||||
|
||||
$total += $row[0];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover centpercent">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Interventions").'</th></tr>'."\n";
|
||||
$listofstatus = array(0, 1, 3);
|
||||
$bool = false;
|
||||
$listofstatus = array(Fichinter::STATUS_DRAFT, Fichinter::STATUS_VALIDATED);
|
||||
if (!empty($conf->global->FICHINTER_CLASSIFY_BILLED)) $listofstatus[] = Fichinter::STATUS_BILLED;
|
||||
|
||||
foreach ($listofstatus as $status) {
|
||||
$dataseries[] = array($fichinterstatic->LibStatut($status, $bool, 1), (isset($vals[$status.$bool]) ? (int) $vals[$status.$bool] : 0));
|
||||
if ($status == 3 && !$bool) {
|
||||
$bool = true;
|
||||
} else {
|
||||
$bool = false;
|
||||
}
|
||||
$dataseries[] = array($fichinterstatic->LibStatut($status, 1), (isset($vals[$status]) ? (int) $vals[$status] : 0));
|
||||
|
||||
if ($status == Fichinter::STATUS_DRAFT) {
|
||||
$colorseries[$status] = '-'.$badgeStatus0;
|
||||
@ -139,10 +128,8 @@ if ($resql) {
|
||||
if ($status == Fichinter::STATUS_BILLED) {
|
||||
$colorseries[$status] = $badgeStatus4;
|
||||
}
|
||||
if ($status == Fichinter::STATUS_CLOSED) {
|
||||
$colorseries[$status] = $badgeStatus6;
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print '<tr class="impair"><td class="center" colspan="2">';
|
||||
|
||||
@ -159,21 +146,15 @@ if ($resql) {
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
$bool = false;
|
||||
foreach ($listofstatus as $status) {
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$fichinterstatic->LibStatut($status, $bool, 0).'</td>';
|
||||
print '<td class="right"><a href="list.php?search_status='.$status.'">'.(isset($vals[$status.$bool]) ? $vals[$status.$bool] : 0).' ';
|
||||
print $fichinterstatic->LibStatut($status, $bool, 3);
|
||||
print '<td class="right"><a href="list.php?search_status='.$status.'">'.(isset($vals[$status]) ? $vals[$status] : 0).' ';
|
||||
print $fichinterstatic->LibStatut($status, 3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
if ($status == 3 && !$bool) {
|
||||
$bool = true;
|
||||
} else {
|
||||
$bool = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/productfournisseurprice.class.php';
|
||||
|
||||
|
||||
/**
|
||||
@ -256,9 +257,10 @@ class ProductFournisseur extends Product
|
||||
* @param string $desc_fourn Custom description for product_fourn_price
|
||||
* @param string $barcode Barcode
|
||||
* @param int $fk_barcode_type Barcode type
|
||||
* @param array $options Extrafields of product fourn price
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '')
|
||||
public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges = 0, $remise_percent = 0, $remise = 0, $newnpr = 0, $delivery_time_days = 0, $supplier_reputation = '', $localtaxes_array = array(), $newdefaultvatcode = '', $multicurrency_buyprice = 0, $multicurrency_price_base_type = 'HT', $multicurrency_tx = 1, $multicurrency_code = '', $desc_fourn = '', $barcode = '', $fk_barcode_type = '', $options = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
@ -407,7 +409,21 @@ class ProductFournisseur extends Product
|
||||
$sql .= ", packaging = ".(empty($packaging) ? 1 : $packaging);
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id);
|
||||
//print $sql;exit;
|
||||
|
||||
if (!$error) {
|
||||
if (!empty($options) && is_array($options)) {
|
||||
$productfournisseurprice = new ProductFournisseurPrice($this->db);
|
||||
$res = $productfournisseurprice->fetch($this->product_fourn_price_id);
|
||||
if ($res > 0) {
|
||||
foreach ($options as $key=>$value) {
|
||||
$productfournisseurprice->array_options[$key] = $value;
|
||||
}
|
||||
$res = $productfournisseurprice->update($user);
|
||||
if ($res < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Add price_base_type and price_ttc
|
||||
|
||||
dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG);
|
||||
@ -493,6 +509,20 @@ class ProductFournisseur extends Product
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!empty($options) && is_array($options)) {
|
||||
$productfournisseurprice = new ProductFournisseurPrice($this->db);
|
||||
$res = $productfournisseurprice->fetch($this->product_fourn_price_id);
|
||||
if ($res > 0) {
|
||||
foreach ($options as $key=>$value) {
|
||||
$productfournisseurprice->array_options[$key] = $value;
|
||||
}
|
||||
$res = $productfournisseurprice->update($user);
|
||||
if ($res < 0) $error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) {
|
||||
// Add record into log table
|
||||
// $this->product_fourn_price_id must be set
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -124,8 +124,6 @@ $title = $langs->trans("Leave").' - '.$langs->trans("Files");
|
||||
|
||||
llxHeader('', $title);
|
||||
|
||||
$edit = false;
|
||||
|
||||
if ($object->id) {
|
||||
$valideur = new User($db);
|
||||
$valideur->fetch($object->fk_validator);
|
||||
@ -176,51 +174,25 @@ if ($object->id) {
|
||||
$starthalfday = ($object->halfday == -1 || $object->halfday == 2) ? 'afternoon' : 'morning';
|
||||
$endhalfday = ($object->halfday == 1 || $object->halfday == 2) ? 'morning' : 'afternoon';
|
||||
|
||||
if (!$edit) {
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($object->date_debut, 'day');
|
||||
print ' ';
|
||||
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->selectDate($object->date_debut, 'date_debut_');
|
||||
print ' ';
|
||||
print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday') ?GETPOST('starthalfday') : $starthalfday));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateDebCP'), $langs->trans("FirstDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($object->date_debut, 'day');
|
||||
print ' ';
|
||||
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$starthalfday]).'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!$edit) {
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($object->date_fin, 'day');
|
||||
print ' ';
|
||||
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->selectDate($object->date_fin, 'date_fin_');
|
||||
print ' ';
|
||||
print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday') ?GETPOST('endhalfday') : $endhalfday));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans('DateFinCP'), $langs->trans("LastDayOfHoliday"));
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_date($object->date_fin, 'day');
|
||||
print ' ';
|
||||
print '<span class="opacitymedium">'.$langs->trans($listhalfday[$endhalfday]).'</span>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Nb days consumed
|
||||
print '<tr>';
|
||||
@ -247,17 +219,10 @@ if ($object->id) {
|
||||
}
|
||||
|
||||
// Description
|
||||
if (!$edit) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DescCP').'</td>';
|
||||
print '<td>'.nl2br($object->description).'</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DescCP').'</td>';
|
||||
print '<td><textarea name="description" class="flat" rows="'.ROWS_3.'" cols="70">'.$object->description.'</textarea></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DescCP').'</td>';
|
||||
print '<td>'.nl2br($object->description).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.dol_print_size($totalsize, 1, 1).'</td></tr>';
|
||||
@ -274,8 +239,7 @@ if ($object->id) {
|
||||
print '<table class="border tableforfield centpercent">'."\n";
|
||||
print '<tbody>';
|
||||
|
||||
if (! empty($object->fk_user_create))
|
||||
{
|
||||
if (! empty($object->fk_user_create)) {
|
||||
$userCreate=new User($db);
|
||||
$userCreate->fetch($object->fk_user_create);
|
||||
print '<tr>';
|
||||
@ -284,19 +248,10 @@ if ($object->id) {
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (!$edit) {
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
|
||||
print '<td>'.$valideur->getNomUrl(-1).'</td>';
|
||||
print '</tr>';
|
||||
} else {
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
|
||||
print '<td>';
|
||||
print $form->select_dolusers($object->fk_user, "valideur", 1, ($user->admin ? '' : array($user->id))); // By default, hierarchical parent
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans('ReviewedByCP').'</td>';
|
||||
print '<td>'.$valideur->getNomUrl(-1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||
|
||||
@ -109,7 +109,7 @@ foreach ($list as $key) {
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -167,6 +167,7 @@ if (empty($array_match_file_to_database)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -742,8 +743,8 @@ if ($step == 3 && $datatoimport) {
|
||||
if ($step == 4 && $datatoimport) {
|
||||
//var_dump($_SESSION["dol_array_match_file_to_database_select"]);
|
||||
$serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : '';
|
||||
$array_match_file_to_database = array();
|
||||
$fieldsarray = explode(',', $serialized_array_match_file_to_database);
|
||||
$array_match_file_to_database = array(); // Same than $fieldsarray but with mapped value only (col1 => 's.fielda', col2 => 's.fieldb'...)
|
||||
foreach ($fieldsarray as $elem) {
|
||||
$tabelem = explode('=', $elem, 2);
|
||||
$key = $tabelem[0];
|
||||
@ -752,6 +753,11 @@ if ($step == 4 && $datatoimport) {
|
||||
$array_match_file_to_database[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($serialized_array_match_file_to_database);
|
||||
//var_dump($fieldsarray);
|
||||
//var_dump($array_match_file_to_database);
|
||||
|
||||
$model = $format;
|
||||
$list = $objmodelimport->liste_modeles($db);
|
||||
|
||||
@ -853,20 +859,15 @@ if ($step == 4 && $datatoimport) {
|
||||
}
|
||||
// We found the key of targets that is at position pos
|
||||
$array_match_file_to_database[$pos] = $key;
|
||||
if ($serialized_array_match_file_to_database) {
|
||||
$serialized_array_match_file_to_database .= ',';
|
||||
}
|
||||
$serialized_array_match_file_to_database .= ($pos.'='.$key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$pos++;
|
||||
}
|
||||
// Save the match array in session. We now will use the array in session.
|
||||
$_SESSION["dol_array_match_file_to_database_select"] = $serialized_array_match_file_to_database;
|
||||
}
|
||||
$array_match_database_to_file = array_flip($array_match_file_to_database);
|
||||
|
||||
//var_dump($array_match_database_to_file);
|
||||
//var_dump($_SESSION["dol_array_match_file_to_database_select"]);
|
||||
|
||||
$fieldstarget_tmp = array();
|
||||
$arraykeysfieldtarget = array_keys($fieldstarget);
|
||||
@ -1088,8 +1089,8 @@ if ($step == 4 && $datatoimport) {
|
||||
$optionsall = array();
|
||||
foreach ($fieldstarget as $code => $line) {
|
||||
//var_dump($line);
|
||||
$labeltoshow = $langs->trans($line["label"]);
|
||||
$optionsall[$code] = array('label'=>$labeltoshow, 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0);
|
||||
$labeltoshow = $langs->transnoentities($line["label"]);
|
||||
$optionsall[$code] = array('labelkey'=>$line['label'], 'label'=>$labeltoshow, 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0);
|
||||
// TODO Get type from an new array into module descriptor.
|
||||
//$picto = 'email';
|
||||
$picto = '';
|
||||
@ -1106,13 +1107,19 @@ if ($step == 4 && $datatoimport) {
|
||||
//var_dump($fieldstarget);
|
||||
//var_dump($optionsall);
|
||||
//exit;
|
||||
/*
|
||||
var_dump($_SESSION['dol_array_match_file_to_database']);
|
||||
var_dump($_SESSION['dol_array_match_file_to_database_select']);
|
||||
var_dump($optionsall);
|
||||
var_dump($fieldssource);
|
||||
var_dump($fieldstarget);
|
||||
*/
|
||||
|
||||
//var_dump($_SESSION['dol_array_match_file_to_database']);
|
||||
//var_dump($_SESSION['dol_array_match_file_to_database_select']);
|
||||
//exit;
|
||||
//var_dump($optionsall);
|
||||
//var_dump($fieldssource);
|
||||
//var_dump($fieldstarget);
|
||||
|
||||
$modetoautofillmapping = 'session'; // Use setup in session
|
||||
if ($initialloadofstep4) {
|
||||
$modetoautofillmapping = 'guess';
|
||||
}
|
||||
//var_dump($modetoautofillmapping);
|
||||
|
||||
print '<table class="nobordernopadding centpercent tableimport">';
|
||||
foreach ($fieldssource as $code => $line) { // $fieldssource is an array code=column num, line=content on first line for column in source file.
|
||||
@ -1132,23 +1139,19 @@ if ($step == 4 && $datatoimport) {
|
||||
print '<td class="nowraponall" style="font-weight: normal">=> </td>';
|
||||
print '<td class="nowraponall" style="font-weight: normal">';
|
||||
|
||||
$modetoautofillmapping = 'session'; // Use setup in session
|
||||
if ($initialloadofstep4) {
|
||||
$modetoautofillmapping = 'guess';
|
||||
}
|
||||
//var_dump($_SESSION['dol_array_match_file_to_database_select']);
|
||||
//var_dump($modetoautofillmapping);
|
||||
//var_dump($_SESSION['dol_array_match_file_to_database']);
|
||||
//var_dump($modetoautofillmapping);
|
||||
|
||||
print '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.($i+1).'">';
|
||||
$selectforline = '';
|
||||
$selectforline .= '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.($i+1).'">';
|
||||
if (!empty($line["imported"])) {
|
||||
print '<option value="-1"> </option>';
|
||||
$selectforline .= '<option value="-1"> </option>';
|
||||
} else {
|
||||
print '<option selected="" value="-1"> </option>';
|
||||
$selectforline .= '<option selected="" value="-1"> </option>';
|
||||
}
|
||||
|
||||
$j = 0;
|
||||
$codeselectedarray = array();
|
||||
foreach ($optionsall as $tmpcode => $tmpval) { // Loop on each entry to add into each combo list.
|
||||
$label = '';
|
||||
if (!empty($tmpval['picto'])) {
|
||||
@ -1158,16 +1161,11 @@ if ($step == 4 && $datatoimport) {
|
||||
$label .= $tmpval['label'];
|
||||
$label .= $tmpval['required'] ? '*</strong>' : '';
|
||||
|
||||
// If we must guess how to fill the preselected value, and we can't because input value are not string
|
||||
if ($modetoautofillmapping == 'guess' && $j == 0 && is_numeric($tmpval)) {
|
||||
$modetoautofillmapping = 'orderoftargets';
|
||||
}
|
||||
|
||||
print '<option value="'.$tmpcode.'"';
|
||||
$selectforline .= '<option value="'.$tmpcode.'"';
|
||||
if ($modetoautofillmapping == 'orderoftargets') {
|
||||
// The mode where we fill the preselected value of combo one by one in order of available targets fields in the declaration in descriptor file.
|
||||
if ($j == $i) {
|
||||
print ' selected';
|
||||
$selectforline .= ' selected';
|
||||
}
|
||||
} elseif ($modetoautofillmapping == 'guess') {
|
||||
// The mode where we try to guess which value to preselect from the name in first column of source file.
|
||||
@ -1179,34 +1177,44 @@ if ($step == 4 && $datatoimport) {
|
||||
$tmpstring1 = $line['example1'];
|
||||
$tmpstring2 = '';
|
||||
}
|
||||
$tmpstring1 = str_replace('*', '', trim($tmpstring1));
|
||||
$tmpstring2 = str_replace('*', '', trim($tmpstring2));
|
||||
if ($tmpstring1 && ($tmpstring1 == $tmpcode || $tmpstring1 == $tmpval)) {
|
||||
print ' selected';
|
||||
// TODO Check that $tmpcode not already selected
|
||||
} elseif ($tmpstring2 && ($tmpstring2 == $tmpcode || $tmpstring2 == $tmpval)) {
|
||||
print ' selected';
|
||||
// TODO Check that $tmpcode not already selected
|
||||
$tmpstring1 = strtolower(str_replace('*', '', trim($tmpstring1)));
|
||||
$tmpstring2 = strtolower(str_replace('*', '', trim($tmpstring2)));
|
||||
|
||||
// $tmpstring1 and $tmpstring2 are string from input file.
|
||||
//var_dump($tmpstring1.' '.$tmpstring2.' '.$tmpval['label'].' '.$tmpval['labelkey']);
|
||||
if ($tmpstring1 && ($tmpstring1 == $tmpcode || $tmpstring1 == strtolower($tmpval['label'])
|
||||
|| $tmpstring1 == strtolower(dol_string_unaccent($tmpval['label'])) || $tmpstring1 == strtolower($tmpval['labelkey']))) {
|
||||
if (empty($codeselectedarray[$code])) {
|
||||
$selectforline .= ' selected';
|
||||
$codeselectedarray[$code] = 1;
|
||||
}
|
||||
} elseif ($tmpstring2 && ($tmpstring2 == $tmpcode || $tmpstring2 == strtolower($tmpval['label'])
|
||||
|| $tmpstring2 == strtolower(dol_string_unaccent($tmpval['label'])) || $tmpstring2 == strtolower($tmpval['labelkey']))) {
|
||||
if (empty($codeselectedarray[$code])) {
|
||||
$selectforline .= ' selected';
|
||||
$codeselectedarray[$code] = 1;
|
||||
}
|
||||
}
|
||||
} elseif ($modetoautofillmapping == 'session' && !empty($_SESSION['dol_array_match_file_to_database_select'])) {
|
||||
$tmpselectioninsession = dolExplodeIntoArray($_SESSION['dol_array_match_file_to_database_select'], ',', '=');
|
||||
//var_dump($code);
|
||||
//var_dump($tmpselectioninsession);
|
||||
//if ($tmpselectioninsession[$j] == $code) {
|
||||
if (!empty($tmpselectioninsession[($i+1)]) && $tmpselectioninsession[($i+1)] == $tmpcode) {
|
||||
print ' selected';
|
||||
$selectforline .= ' selected';
|
||||
}
|
||||
print ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.(!empty($tmpselectioninsession[($i+1)]) ? $tmpselectioninsession[($i+1)] : "").'"';
|
||||
$selectforline .= ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.(!empty($tmpselectioninsession[($i+1)]) ? $tmpselectioninsession[($i+1)] : "").'"';
|
||||
}
|
||||
print ' data-html="'.dol_escape_htmltag($label).'"';
|
||||
print '>';
|
||||
print $label;
|
||||
print '</options>';
|
||||
$selectforline .= ' data-html="'.dol_escape_htmltag($label).'"';
|
||||
$selectforline .= '>';
|
||||
$selectforline .= $label;
|
||||
$selectforline .= '</options>';
|
||||
$j++;
|
||||
}
|
||||
print '</select>';
|
||||
print ajax_combobox('selectorderimport_'.($i+1));
|
||||
print "</td>";
|
||||
$selectforline .= '</select>';
|
||||
$selectforline .= ajax_combobox('selectorderimport_'.($i+1));
|
||||
|
||||
print $selectforline;
|
||||
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowraponall" style="font-weight:normal; text-align:right">';
|
||||
$filecolumn = ($i + 1);
|
||||
@ -1317,18 +1325,21 @@ if ($step == 4 && $datatoimport) {
|
||||
print ' console.log("Remove the disabled flag everywhere");'."\n";
|
||||
print ' $("select.targetselectchange").not($( this )).find(\'option\').prop("disabled", false);'."\n"; // Enable all options
|
||||
print ' arrayofselectedvalues = [];'."\n";
|
||||
|
||||
print ' $("select.targetselectchange").each(function(){'."\n";
|
||||
print ' id = $(this).attr(\'id\')'."\n";
|
||||
print ' value = $(this).val()'."\n";
|
||||
//print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n";
|
||||
print ' console.log("a selected value has been found for component "+id+" = "+value);'."\n";
|
||||
print ' arrayofselectedvalues.push(value);'."\n";
|
||||
print ' });'."\n";
|
||||
print ' console.log("List of all selected values");'."\n";
|
||||
|
||||
print ' console.log("List of all selected values arrayofselectedvalues");'."\n";
|
||||
print ' console.log(arrayofselectedvalues);'."\n";
|
||||
print ' console.log("Set the option to disabled for every entry that is currently selected somewhere else (so into arrayofselectedvalues)");'."\n";
|
||||
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n"; // Loop on each selected value
|
||||
|
||||
print ' $.each(arrayofselectedvalues, function(key, value) {'."\n"; // Loop on each selected value
|
||||
print ' if (value != -1) {'."\n";
|
||||
//print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n";
|
||||
print ' console.log("Process key="+key+" value="+value+" to disable.");'."\n";
|
||||
print ' $("select.targetselectchange").find(\'option[value="\'+value+\'"]:not(:selected)\').prop("disabled", true);'."\n"; // Set to disabled except if currently selected
|
||||
print ' }'."\n";
|
||||
print ' });'."\n";
|
||||
@ -1338,12 +1349,13 @@ if ($step == 4 && $datatoimport) {
|
||||
print 'function saveSelection() {'."\n";
|
||||
//print ' console.log(arrayofselectedvalues);'."\n";
|
||||
print ' arrayselectedfields = [];'."\n";
|
||||
print ' arrayselectedfields.push("0");'."\n";
|
||||
print ' arrayselectedfields.push(0);'."\n";
|
||||
|
||||
print ' $.each( arrayofselectedvalues, function( key, value ) {'."\n";
|
||||
print ' if (value != -1) {'."\n";
|
||||
print ' arrayselectedfields.push(value);'."\n";
|
||||
print ' arrayselectedfields.push(value);'."\n";
|
||||
print ' } else {'."\n";
|
||||
print ' arrayselectedfields.push(0);'."\n";
|
||||
print ' arrayselectedfields.push(0);'."\n";
|
||||
print ' }'."\n";
|
||||
print ' });'."\n";
|
||||
|
||||
@ -1353,12 +1365,14 @@ if ($step == 4 && $datatoimport) {
|
||||
print " url: '".dol_escape_js($_SERVER["PHP_SELF"])."?action=saveselectorder&token=".newToken()."',\n";
|
||||
print " data: 'selectorder='+arrayselectedfields.toString(),\n";
|
||||
print " success: function(){\n";
|
||||
print " console.log('Select order saved');\n";
|
||||
print " console.log('The selected fields have been saved into '+arrayselectedfields.toString());\n";
|
||||
print " },\n";
|
||||
print ' });'."\n";
|
||||
|
||||
// Now we loop on all target fields that are mandatory to show if they are not mapped yet.
|
||||
print ' console.log("arrayselectedfields");';
|
||||
print ' console.log(arrayselectedfields);';
|
||||
print ' console.log("arrayoftargetmandatoryfields");';
|
||||
print ' console.log(arrayoftargetmandatoryfields);';
|
||||
print " listtoshow = '';";
|
||||
print " nbelement = arrayoftargetmandatoryfields.length
|
||||
@ -1886,16 +1900,17 @@ if ($step == 5 && $datatoimport) {
|
||||
|
||||
// Show OK
|
||||
if (!count($arrayoferrors) && !count($arrayofwarnings)) {
|
||||
print '<div class="center">'.img_picto($langs->trans("OK"), 'tick').' <b>'.$langs->trans("NoError").'</b></div><br><br>';
|
||||
print '<div class="ok">';
|
||||
print '<br>';
|
||||
print '<div class="info">';
|
||||
print '<div class=""><b>'.$langs->trans("ResultOfSimulationNoError").'</b></div>';
|
||||
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
} else {
|
||||
print '<br>';
|
||||
print '<div class="info">';
|
||||
print $langs->trans("NbOfLinesOK", $nbok).'<br>';
|
||||
print '<div class="warning">';
|
||||
print $langs->trans("NbOfLinesOK", $nbok).'...<br>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
@ -2281,10 +2296,10 @@ if ($step == 6 && $datatoimport) {
|
||||
|
||||
// Show result
|
||||
print '<br>';
|
||||
print '<div class="ok">';
|
||||
print '<div class="info">';
|
||||
print $langs->trans("NbOfLinesImported", $nbok).'</b><br>';
|
||||
print $langs->trans("NbInsert", empty($obj->nbinsert) ? 0 : $obj->nbinsert).'<br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br><br>';
|
||||
print $langs->trans("NbUpdate", empty($obj->nbupdate) ? 0 : $obj->nbupdate).'<br>';
|
||||
print '</div>';
|
||||
print '<div class="center">';
|
||||
print $langs->trans("FileWasImported", $importid).'<br>';
|
||||
|
||||
@ -181,48 +181,48 @@ ALTER TABLE llx_stock_mouvement_extrafields ADD INDEX idx_stock_mouvement_extraf
|
||||
CREATE TABLE llx_facture_fourn_rec
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
titre varchar(200) NOT NULL,
|
||||
ref_supplier varchar(180) NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
fk_soc integer NOT NULL,
|
||||
titre varchar(200) NOT NULL,
|
||||
ref_supplier varchar(180) NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
fk_soc integer NOT NULL,
|
||||
datec datetime,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
suspended integer DEFAULT 0,
|
||||
libelle varchar(255),
|
||||
amount double(24, 8) DEFAULT 0 NOT NULL,
|
||||
remise real DEFAULT 0,
|
||||
vat_src_code varchar(10) DEFAULT '',
|
||||
localtax1 double(24,8) DEFAULT 0,
|
||||
localtax2 double(24,8) DEFAULT 0,
|
||||
total_ht double(24,8) DEFAULT 0,
|
||||
total_tva double(24,8) DEFAULT 0,
|
||||
total_ttc double(24,8) DEFAULT 0,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
suspended integer DEFAULT 0,
|
||||
libelle varchar(255),
|
||||
amount double(24,8) DEFAULT 0 NOT NULL,
|
||||
remise real DEFAULT 0,
|
||||
vat_src_code varchar(10) DEFAULT '',
|
||||
localtax1 double(24,8) DEFAULT 0,
|
||||
localtax2 double(24,8) DEFAULT 0,
|
||||
total_ht double(24,8) DEFAULT 0,
|
||||
total_tva double(24,8) DEFAULT 0,
|
||||
total_ttc double(24,8) DEFAULT 0,
|
||||
fk_user_author integer,
|
||||
fk_user_modif integer,
|
||||
fk_projet integer,
|
||||
fk_account integer,
|
||||
fk_cond_reglement integer,
|
||||
fk_mode_reglement integer,
|
||||
fk_cond_reglement integer,
|
||||
fk_mode_reglement integer,
|
||||
date_lim_reglement date,
|
||||
note_private text,
|
||||
note_public text,
|
||||
modelpdf varchar(255),
|
||||
fk_multicurrency integer,
|
||||
multicurrency_code varchar(3),
|
||||
multicurrency_tx double(24,8) DEFAULT 1,
|
||||
multicurrency_total_ht double(24,8) DEFAULT 0,
|
||||
multicurrency_total_tva double(24,8) DEFAULT 0,
|
||||
multicurrency_total_ttc double(24,8) DEFAULT 0,
|
||||
usenewprice integer DEFAULT 0,
|
||||
multicurrency_tx double(24,8) DEFAULT 1,
|
||||
multicurrency_total_ht double(24,8) DEFAULT 0,
|
||||
multicurrency_total_tva double(24,8) DEFAULT 0,
|
||||
multicurrency_total_ttc double(24,8) DEFAULT 0,
|
||||
usenewprice integer DEFAULT 0,
|
||||
frequency integer,
|
||||
unit_frequency varchar(2) DEFAULT 'm',
|
||||
date_when datetime DEFAULT NULL,
|
||||
date_last_gen datetime DEFAULT NULL,
|
||||
nb_gen_done integer DEFAULT NULL,
|
||||
nb_gen_max integer DEFAULT NULL,
|
||||
auto_validate integer DEFAULT 0,
|
||||
generate_pdf integer DEFAULT 1
|
||||
)ENGINE=innodb;
|
||||
unit_frequency varchar(2) DEFAULT 'm',
|
||||
date_when datetime DEFAULT NULL,
|
||||
date_last_gen datetime DEFAULT NULL,
|
||||
nb_gen_done integer DEFAULT NULL,
|
||||
nb_gen_max integer DEFAULT NULL,
|
||||
auto_validate integer DEFAULT 0,
|
||||
generate_pdf integer DEFAULT 1
|
||||
) ENGINE=innodb;
|
||||
|
||||
ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref (titre, entity);
|
||||
ALTER TABLE llx_facture_fourn_rec ADD UNIQUE INDEX uk_facture_fourn_rec_ref_supplier (ref_supplier, fk_soc, entity);
|
||||
@ -251,23 +251,23 @@ CREATE TABLE llx_facture_fourn_det_rec
|
||||
fk_parent_line integer NULL,
|
||||
fk_product integer NULL,
|
||||
ref varchar(50),
|
||||
label varchar(255) DEFAULT NULL,
|
||||
label varchar(255) DEFAULT NULL,
|
||||
description text,
|
||||
pu_ht double(24,8),
|
||||
pu_ttc double(24,8),
|
||||
qty real,
|
||||
remise_percent real DEFAULT 0,
|
||||
fk_remise_except integer NULL,
|
||||
vat_src_code varchar(10) DEFAULT '',
|
||||
remise_percent real DEFAULT 0,
|
||||
fk_remise_except integer NULL,
|
||||
vat_src_code varchar(10) DEFAULT '',
|
||||
tva_tx double(7,4),
|
||||
localtax1_tx double(7,4) DEFAULT 0,
|
||||
localtax1_type varchar(10) NULL,
|
||||
localtax2_tx double(7,4) DEFAULT 0,
|
||||
localtax2_type varchar(10) NULL,
|
||||
localtax1_tx double(7,4) DEFAULT 0,
|
||||
localtax1_type varchar(10) NULL,
|
||||
localtax2_tx double(7,4) DEFAULT 0,
|
||||
localtax2_type varchar(10) NULL,
|
||||
total_ht double(24,8),
|
||||
total_tva double(24,8),
|
||||
total_localtax1 double(24,8) DEFAULT 0,
|
||||
total_localtax2 double(24,8) DEFAULT 0,
|
||||
total_localtax1 double(24,8) DEFAULT 0,
|
||||
total_localtax2 double(24,8) DEFAULT 0,
|
||||
total_ttc double(24,8),
|
||||
product_type integer DEFAULT 0,
|
||||
date_start integer DEFAULT NULL,
|
||||
@ -285,17 +285,20 @@ CREATE TABLE llx_facture_fourn_det_rec
|
||||
multicurrency_total_ht double(24,8) DEFAULT 0,
|
||||
multicurrency_total_tva double(24,8) DEFAULT 0,
|
||||
multicurrency_total_ttc double(24,8) DEFAULT 0
|
||||
)ENGINE=innodb;
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_facture_fourn_det_rec ADD CONSTRAINT fk_facture_fourn_det_rec_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid);
|
||||
|
||||
|
||||
CREATE TABLE llx_facture_fourn_det_rec_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_object integer NOT NULL, -- object id
|
||||
import_key varchar(14) -- import key
|
||||
)ENGINE=innodb;
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_facture_fourn_det_rec_extrafields ADD INDEX idx_facture_fourn_det_rec_extrafields (fk_object);
|
||||
|
||||
@ -314,7 +317,8 @@ ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN position INTEGER NOT NU
|
||||
|
||||
ALTER TABLE llx_advtargetemailing RENAME TO llx_mailing_advtarget;
|
||||
|
||||
ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing(titre, entity);
|
||||
ALTER TABLE llx_mailing ADD UNIQUE INDEX uk_mailing (titre, entity);
|
||||
|
||||
|
||||
create table llx_inventory_extrafields
|
||||
(
|
||||
@ -324,6 +328,7 @@ create table llx_inventory_extrafields
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_inventory_extrafields ADD INDEX idx_inventory_extrafields (fk_object);
|
||||
|
||||
ALTER TABLE llx_reception MODIFY COLUMN ref_supplier varchar(128);
|
||||
@ -364,136 +369,149 @@ ALTER TABLE llx_asset ADD COLUMN model_pdf varchar(255) AFTER import_key;
|
||||
|
||||
DROP TABLE llx_asset_type;
|
||||
|
||||
|
||||
CREATE TABLE llx_c_asset_disposal_type
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50) NOT NULL,
|
||||
active integer DEFAULT 1 NOT NULL
|
||||
)ENGINE=innodb;
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer NOT NULL DEFAULT 1,
|
||||
code varchar(16) NOT NULL,
|
||||
label varchar(50) NOT NULL,
|
||||
active integer NOT NULL DEFAULT 1
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_accountancy_codes_economic(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
|
||||
CREATE TABLE llx_asset_accountancy_codes_economic
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
asset varchar(32),
|
||||
depreciation_asset varchar(32),
|
||||
depreciation_expense varchar(32),
|
||||
value_asset_sold varchar(32),
|
||||
receivable_on_assignment varchar(32),
|
||||
proceeds_from_sales varchar(32),
|
||||
vat_collected varchar(32),
|
||||
vat_deductible varchar(32),
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
CREATE TABLE llx_asset_accountancy_codes_fiscal
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
asset varchar(32),
|
||||
depreciation_asset varchar(32),
|
||||
depreciation_expense varchar(32),
|
||||
value_asset_sold varchar(32),
|
||||
receivable_on_assignment varchar(32),
|
||||
proceeds_from_sales varchar(32),
|
||||
vat_collected varchar(32),
|
||||
vat_deductible varchar(32),
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_accountancy_codes_fiscal(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
accelerated_depreciation varchar(32),
|
||||
accelerated_depreciation varchar(32),
|
||||
endowment_accelerated_depreciation varchar(32),
|
||||
provision_accelerated_depreciation varchar(32),
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_depreciation_options_economic(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
|
||||
accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal)
|
||||
CREATE TABLE llx_asset_depreciation_options_economic
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
degressive_coefficient double(24,8),
|
||||
duration smallint NOT NULL,
|
||||
duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
|
||||
depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
|
||||
accelerated_depreciation_option integer, -- activate accelerated depreciation mode (fiscal)
|
||||
|
||||
amount_base_depreciation_ht double(24,8),
|
||||
amount_base_deductible_ht double(24,8),
|
||||
total_amount_last_depreciation_ht double(24,8),
|
||||
degressive_coefficient double(24,8),
|
||||
duration smallint NOT NULL,
|
||||
duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
amount_base_depreciation_ht double(24,8),
|
||||
amount_base_deductible_ht double(24,8),
|
||||
total_amount_last_depreciation_ht double(24,8),
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_depreciation_options_fiscal(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
|
||||
CREATE TABLE llx_asset_depreciation_options_fiscal
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
fk_asset integer,
|
||||
fk_asset_model integer,
|
||||
|
||||
degressive_coefficient double(24,8),
|
||||
duration smallint NOT NULL,
|
||||
duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
|
||||
depreciation_type smallint DEFAULT 0 NOT NULL, -- 0:linear, 1:degressive, 2:exceptional
|
||||
|
||||
amount_base_depreciation_ht double(24,8),
|
||||
amount_base_deductible_ht double(24,8),
|
||||
total_amount_last_depreciation_ht double(24,8),
|
||||
degressive_coefficient double(24,8),
|
||||
duration smallint NOT NULL,
|
||||
duration_type smallint DEFAULT 0 NOT NULL, -- 0:annual, 1:monthly, 2:daily
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
amount_base_depreciation_ht double(24,8),
|
||||
amount_base_deductible_ht double(24,8),
|
||||
total_amount_last_depreciation_ht double(24,8),
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_depreciation(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
|
||||
fk_asset integer NOT NULL,
|
||||
depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other)
|
||||
CREATE TABLE llx_asset_depreciation
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
|
||||
ref varchar(255) NOT NULL,
|
||||
depreciation_date datetime NOT NULL,
|
||||
depreciation_ht double(24,8) NOT NULL,
|
||||
cumulative_depreciation_ht double(24,8) NOT NULL,
|
||||
fk_asset integer NOT NULL,
|
||||
depreciation_mode varchar(255) NOT NULL, -- (economic, fiscal or other)
|
||||
|
||||
accountancy_code_debit varchar(32),
|
||||
accountancy_code_credit varchar(32),
|
||||
ref varchar(255) NOT NULL,
|
||||
depreciation_date datetime NOT NULL,
|
||||
depreciation_ht double(24,8) NOT NULL,
|
||||
cumulative_depreciation_ht double(24,8) NOT NULL,
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
accountancy_code_debit varchar(32),
|
||||
accountancy_code_credit varchar(32),
|
||||
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_modif integer
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
CREATE TABLE llx_asset_model(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
ref varchar(128) NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
|
||||
asset_type smallint NOT NULL,
|
||||
fk_pays integer DEFAULT 0,
|
||||
asset_type smallint NOT NULL,
|
||||
fk_pays integer DEFAULT 0,
|
||||
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
status smallint NOT NULL
|
||||
note_public text,
|
||||
note_private text,
|
||||
date_creation datetime NOT NULL,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_user_creat integer NOT NULL,
|
||||
fk_user_modif integer,
|
||||
import_key varchar(14),
|
||||
status smallint NOT NULL
|
||||
) ENGINE=innodb;
|
||||
|
||||
CREATE TABLE llx_asset_model_extrafields
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
fk_object integer NOT NULL,
|
||||
import_key varchar(14) -- import key
|
||||
) ENGINE=innodb;
|
||||
|
||||
|
||||
ALTER TABLE llx_c_asset_disposal_type ADD UNIQUE INDEX uk_c_asset_disposal_type(code, entity);
|
||||
|
||||
ALTER TABLE llx_asset ADD INDEX idx_asset_fk_asset_model (fk_asset_model);
|
||||
ALTER TABLE llx_asset ADD INDEX idx_asset_fk_disposal_type (fk_disposal_type);
|
||||
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid);
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_disposal_type FOREIGN KEY (fk_disposal_type) REFERENCES llx_c_asset_disposal_type (rowid);
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset ADD CONSTRAINT fk_asset_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
@ -501,33 +519,33 @@ ALTER TABLE llx_asset_accountancy_codes_economic ADD INDEX idx_asset_ace_rowid (
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset (fk_asset);
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD UNIQUE uk_asset_ace_fk_asset_model (fk_asset_model);
|
||||
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_economic ADD CONSTRAINT fk_asset_ace_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD INDEX idx_asset_acf_rowid (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset (fk_asset);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD UNIQUE uk_asset_acf_fk_asset_model (fk_asset_model);
|
||||
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset_accountancy_codes_fiscal ADD CONSTRAINT fk_asset_acf_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD INDEX idx_asset_doe_rowid (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset (fk_asset);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD UNIQUE uk_asset_doe_fk_asset_model (fk_asset_model);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_economic ADD CONSTRAINT fk_asset_doe_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD INDEX idx_asset_dof_rowid (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset (fk_asset);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD UNIQUE uk_asset_dof_fk_asset_model (fk_asset_model);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_asset_model FOREIGN KEY (fk_asset_model) REFERENCES llx_asset_model (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_depreciation_options_fiscal ADD CONSTRAINT fk_asset_dof_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_rowid (rowid);
|
||||
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_fk_asset (fk_asset);
|
||||
@ -535,8 +553,8 @@ ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_depreciation
|
||||
ALTER TABLE llx_asset_depreciation ADD INDEX idx_asset_depreciation_ref (ref);
|
||||
ALTER TABLE llx_asset_depreciation ADD UNIQUE uk_asset_depreciation_fk_asset (fk_asset, depreciation_mode, ref);
|
||||
|
||||
ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_asset FOREIGN KEY (fk_asset) REFERENCES llx_asset (rowid);
|
||||
ALTER TABLE llx_asset_depreciation ADD CONSTRAINT fk_asset_depreciation_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_rowid (rowid);
|
||||
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_ref (ref);
|
||||
@ -544,8 +562,8 @@ ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_pays (fk_pays);
|
||||
ALTER TABLE llx_asset_model ADD INDEX idx_asset_model_entity (entity);
|
||||
ALTER TABLE llx_asset_model ADD UNIQUE INDEX uk_asset_model (entity, ref);
|
||||
|
||||
ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
|
||||
ALTER TABLE llx_asset_model ADD CONSTRAINT fk_asset_model_user_modif FOREIGN KEY (fk_user_modif) REFERENCES llx_user (rowid);
|
||||
|
||||
ALTER TABLE llx_asset_model_extrafields ADD INDEX idx_asset_model_extrafields (fk_object);
|
||||
|
||||
@ -581,10 +599,11 @@ UPDATE llx_c_availability SET type_duration = 'w', qty = 4 WHERE code = 'AV_4W';
|
||||
|
||||
|
||||
-- Deposit generation helper with specific payment terms
|
||||
ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage;
|
||||
ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement;
|
||||
ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
|
||||
ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
|
||||
ALTER TABLE llx_c_payment_term ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER decalage;
|
||||
ALTER TABLE llx_societe ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER cond_reglement;
|
||||
ALTER TABLE llx_propal ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
|
||||
ALTER TABLE llx_commande ADD COLUMN deposit_percent VARCHAR(63) DEFAULT NULL AFTER fk_cond_reglement;
|
||||
|
||||
INSERT INTO llx_c_payment_term(code, sortorder, active, libelle, libelle_facture, type_cdr, nbjour, deposit_percent) values ('DEP30PCTDEL', 13, 0, '__DEPOSIT_PERCENT__% deposit', '__DEPOSIT_PERCENT__% deposit, remainder on delivery', 0, 1, '30');
|
||||
|
||||
|
||||
@ -599,13 +618,13 @@ DELETE FROM llx_boxes_def WHERE file IN ('box_bom.php@bom', 'box_bom.php', 'box_
|
||||
|
||||
ALTER TABLE llx_takepos_floor_tables ADD UNIQUE(entity,label);
|
||||
|
||||
ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255);
|
||||
ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128);
|
||||
ALTER TABLE llx_partnership ADD COLUMN url_to_check varchar(255);
|
||||
ALTER TABLE llx_c_partnership_type ADD COLUMN keyword varchar(128);
|
||||
|
||||
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN firstname varchar(100);
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN lastname varchar(100);
|
||||
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN email_company varchar(128) after email;
|
||||
|
||||
|
||||
ALTER TABLE llx_c_email_template ADD COLUMN email_from varchar(255);
|
||||
|
||||
@ -18,22 +18,23 @@
|
||||
--
|
||||
-- ===================================================================
|
||||
--
|
||||
-- statut
|
||||
-- 0 : actif
|
||||
-- 1 : inactif
|
||||
-- state / statut
|
||||
-- 0 : active / actif
|
||||
-- 1 : inactive / inactif
|
||||
--
|
||||
|
||||
create table llx_adherent_type
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
entity integer DEFAULT 1 NOT NULL, -- multi company id
|
||||
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
statut smallint NOT NULL DEFAULT 0,
|
||||
libelle varchar(50) NOT NULL,
|
||||
morphy varchar(3) NOT NULL,
|
||||
duration varchar(6) DEFAULT NULL,
|
||||
subscription varchar(3) NOT NULL DEFAULT '1',
|
||||
amount double(24,8) DEFAULT NULL,
|
||||
vote varchar(3) NOT NULL DEFAULT '1',
|
||||
note text,
|
||||
mail_valid text
|
||||
statut smallint NOT NULL DEFAULT 0, -- state 0 = active , 1 = inactive
|
||||
libelle varchar(50) NOT NULL, -- label
|
||||
morphy varchar(3) NOT NULL, -- moral and/or physical entity
|
||||
duration varchar(6) DEFAULT NULL, -- (minimal) duration of membership
|
||||
subscription varchar(3) NOT NULL DEFAULT '1', -- subscription with costs / fee or without / for free
|
||||
amount double(24,8) DEFAULT NULL, -- membership fee
|
||||
vote varchar(3) NOT NULL DEFAULT '1', -- entitled to vote
|
||||
note text, -- description / comment
|
||||
mail_valid text -- text for welcome email
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -117,7 +117,7 @@ foreach ($list_DEB as $key) {
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="left">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -181,7 +181,7 @@ foreach ($list_DES as $key) {
|
||||
print '<td>'.$label.'</td>';
|
||||
// Value
|
||||
print '<td class="left">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" class="maxwidth100" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -2252,13 +2252,21 @@ TemplateforBusinessCards=Template for a business card in different size
|
||||
InventorySetup= Inventory Setup
|
||||
ExportUseLowMemoryMode=Use a low memory mode
|
||||
ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails.
|
||||
ShowQuickAddLink=Show a button to quickly add an object, in top right menu
|
||||
|
||||
ModuleWebhookName = Webhook
|
||||
ModuleWebhookDesc = Interface to catch dolibarr triggers and send it to an URL
|
||||
WebhookSetup = Webhook setup
|
||||
Settings = Settings
|
||||
WebhookSetupPage = Webhook setup page
|
||||
ShowQuickAddLink=Show a button to quickly add an element in top right menu
|
||||
|
||||
HashForPing=Hash used for ping
|
||||
ReadOnlyMode=Is instance in "Read Only" mode
|
||||
DEBUGBAR_USE_LOG_FILE=Use the <b>dolibarr.log</b> file to trap Logs
|
||||
UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended.
|
||||
FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
|
||||
DefaultOpportunityStatus=Default opportunity status (first status when lead is created)
|
||||
|
||||
IconAndText=Icon and text
|
||||
TextOnly=Text only
|
||||
IconOnlyAllTextsOnHover=Icon only - All texts appears under icon on mouse hover menu bar
|
||||
@ -2268,4 +2276,4 @@ INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices
|
||||
INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices
|
||||
INVOICE_ADD_SWISS_QR_CODE=Show the swiss QR-Bill code on invoices
|
||||
UrlSocialNetworksDesc=Url link of social network. Use {socialid} for the variable part that contains the social network ID.
|
||||
IfThisCategoryIsChildOfAnother=If this category is a child of another one
|
||||
IfThisCategoryIsChildOfAnother=If this category is a child of another one
|
||||
|
||||
@ -95,6 +95,7 @@ ShowCategory=Show tag/category
|
||||
ByDefaultInList=By default in list
|
||||
ChooseCategory=Choose category
|
||||
StocksCategoriesArea=Warehouse Categories
|
||||
TicketsCategoriesArea=Tickets Categories
|
||||
ActionCommCategoriesArea=Event Categories
|
||||
WebsitePagesCategoriesArea=Page-Container Categories
|
||||
KnowledgemanagementsCategoriesArea=KM article Categories
|
||||
|
||||
@ -141,4 +141,5 @@ WarningFirstImportedLine=The first line(s) will not be imported with the current
|
||||
NotUsedFields=Fields of database not used
|
||||
SelectImportFieldsSource = Choose the source file fields you want to import and their target field in database by choosing the fields in each select boxes, or select a predefined import profile:
|
||||
MandatoryTargetFieldsNotMapped=Some mandatory target fields are not mapped
|
||||
AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped
|
||||
AllTargetMandatoryFieldsAreMapped=All target fields that need a mandatory value are mapped
|
||||
ResultOfSimulationNoError=Result of simulation: No error
|
||||
@ -747,7 +747,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
// Available
|
||||
print '<td align="right">';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
@ -756,7 +756,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
}
|
||||
// Lot - serial
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Batch");
|
||||
@ -787,11 +787,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<input type="submit" class="button buttongen button-add" name="addconsumelinebutton" value="'.$langs->trans("Add").'">';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="canceladdconsumelinebutton" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Lot - serial
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action
|
||||
@ -909,7 +909,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
// Stock
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td class="nowraponall right">';
|
||||
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
|
||||
print img_warning($langs->trans('StockTooLow')).' ';
|
||||
@ -918,7 +918,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
}
|
||||
// Lot
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action delete line
|
||||
@ -965,12 +965,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Lot Batch
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($line2['batch'] != '') {
|
||||
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
|
||||
@ -1033,12 +1033,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
|
||||
// Stock
|
||||
if ($conf->stock->enabled) {
|
||||
if (isModEnabled('stock')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Lot / Batch
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($tmpproduct->status_batch) {
|
||||
$preselected = (GETPOSTISSET('batch-'.$line->id.'-'.$i) ? GETPOST('batch-'.$line->id.'-'.$i) : '');
|
||||
@ -1121,7 +1121,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $langs->trans("Warehouse");
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Batch");
|
||||
@ -1149,7 +1149,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="canceladdproducelinebutton" value="'.$langs->trans("Cancel").'">';
|
||||
print '</td>';
|
||||
// Lot - serial
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>';
|
||||
}
|
||||
// Action
|
||||
@ -1236,7 +1236,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td>';
|
||||
print '<td>'; // Warehouse
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td></td>'; // Lot
|
||||
}
|
||||
|
||||
@ -1277,7 +1277,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($line2['batch'] != '') {
|
||||
$tmpbatch->fetch(0, $line2['fk_product'], $line2['batch']);
|
||||
@ -1324,7 +1324,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoStockChangeOnServices").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($tmpproduct->status_batch) {
|
||||
$preselected = (GETPOSTISSET('batchtoproduce-'.$line->id.'-'.$i) ? GETPOST('batchtoproduce-'.$line->id.'-'.$i) : '');
|
||||
|
||||
@ -1860,7 +1860,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
|
||||
// Batch number managment
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
if ($object->isProduct() || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
|
||||
print '<tr><td>'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
$statutarray = array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch"), '2' => $langs->trans("ProductStatusOnSerial"));
|
||||
@ -1964,7 +1964,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
|
||||
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
|
||||
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, !empty($conf->global->FCKEDITOR_ENABLE_PRODUCTDESC)?$conf->global->FCKEDITOR_ENABLE_PRODUCTDESC:0, ROWS_4, '90%');
|
||||
$doleditor = new DolEditor('desc', $object->description, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print "</td></tr>";
|
||||
@ -2146,7 +2146,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!empty($conf->global->MAIN_DISABLE_NOTES_TAB)) {
|
||||
print '<tr><td class="tdtop">'.$langs->trans("NoteNotVisibleOnBill").'</td><td>';
|
||||
|
||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
||||
$doleditor = new DolEditor('note_private', $object->note_private, '', 140, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print "</td></tr>";
|
||||
|
||||
@ -285,34 +285,8 @@ if (empty($reshook)) {
|
||||
if (GETPOSTISSET('ref_fourn_price_id')) {
|
||||
$object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int'));
|
||||
}
|
||||
|
||||
$extralabels = $extrafields->fetch_name_optionals_label("product_fournisseur_price");
|
||||
$extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price");
|
||||
if (!empty($extrafield_values)) {
|
||||
$resql = $db->query("SELECT fk_object FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields WHERE fk_object = ".((int) $object->product_fourn_price_id));
|
||||
// Insert a new extrafields row, if none exists
|
||||
if ($db->num_rows($resql) != 1) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields (fk_object, ";
|
||||
foreach ($extrafield_values as $key => $value) {
|
||||
$sql .= str_replace('options_', '', $key).', ';
|
||||
}
|
||||
$sql = substr($sql, 0, strlen($sql) - 2).") VALUES (".((int) $object->product_fourn_price_id).", ";
|
||||
foreach ($extrafield_values as $key => $value) {
|
||||
$sql .= "'".$db->escape($value)."', ";
|
||||
}
|
||||
$sql = substr($sql, 0, strlen($sql) - 2).')';
|
||||
} else {
|
||||
// update the existing one
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields SET ";
|
||||
foreach ($extrafield_values as $key => $value) {
|
||||
$sql .= str_replace('options_', '', $key)." = '".$db->escape($value)."', ";
|
||||
}
|
||||
$sql = substr($sql, 0, strlen($sql) - 2).' WHERE fk_object = '.((int) $object->product_fourn_price_id);
|
||||
}
|
||||
|
||||
// Execute the sql command from above
|
||||
$db->query($sql);
|
||||
}
|
||||
|
||||
$newprice = price2num(GETPOST("price", "alpha"));
|
||||
|
||||
@ -330,9 +304,9 @@ if (empty($reshook)) {
|
||||
$multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha'));
|
||||
$multicurrency_code = GETPOST("multicurrency_code", 'alpha');
|
||||
|
||||
$ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, GETPOST("multicurrency_price_base_type"), $multicurrency_tx, $multicurrency_code, $supplier_description, $barcode, $fk_barcode_type);
|
||||
$ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', $multicurrency_price, GETPOST("multicurrency_price_base_type"), $multicurrency_tx, $multicurrency_code, $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
|
||||
} else {
|
||||
$ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description, $barcode, $fk_barcode_type);
|
||||
$ret = $object->update_buyprice($quantity, $newprice, $user, GETPOST("price_base_type"), $supplier, GETPOST("oselDispo"), $ref_fourn, $tva_tx, GETPOST("charges"), $remise_percent, 0, $npr, $delivery_time_days, $supplier_reputation, array(), '', 0, 'HT', 1, '', $supplier_description, $barcode, $fk_barcode_type, $extrafield_values);
|
||||
}
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
@ -806,7 +780,7 @@ END;
|
||||
print '<td>'.$langs->trans('ProductSupplierDescription').'</td>';
|
||||
print '<td>';
|
||||
|
||||
$doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
|
||||
$doleditor = new DolEditor('supplier_description', $object->desc_supplier, '', 160, 'dolibarr_details', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -308,7 +308,7 @@ class Inventory extends CommonObject
|
||||
$inventoryline->batch = $obj->batch;
|
||||
$inventoryline->datec = dol_now();
|
||||
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
|
||||
} else {
|
||||
$inventoryline->qty_stock = $obj->reel;
|
||||
|
||||
@ -569,7 +569,7 @@ print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('WarehouseTarget'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans('Qty'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'center tagtd maxwidthonsmartphone ');
|
||||
@ -601,7 +601,7 @@ print img_picto($langs->trans("Product"), 'product', 'class="paddingright"');
|
||||
print $form->select_produits($id_product, 'productid', $filtertype, $limit, 0, -1, 2, '', 1, array(), 0, '1', 0, 'minwidth200imp maxwidth300', 1, '', null, 1);
|
||||
print '</td>';
|
||||
// Batch number
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
print img_picto($langs->trans("LotSerial"), 'lot', 'class="paddingright"');
|
||||
print '<input type="text" name="batch" class="flat maxwidth50" value="'.$batch.'">';
|
||||
@ -643,7 +643,7 @@ foreach ($listofdata as $key => $val) {
|
||||
print '<td>';
|
||||
print $productstatic->getNomUrl(1).' - '.$productstatic->label;
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
print $val['batch'];
|
||||
print '</td>';
|
||||
|
||||
@ -631,7 +631,7 @@ if ($id > 0 || $ref) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<tr><td class="">'.$langs->trans("ManageLotSerial").'</td><td>';
|
||||
print $object->getLibStatut(0, 2);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -749,7 +749,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print getTitleFieldOfList($langs->trans('Batch'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans('WarehouseSource'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
@ -789,7 +789,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($action === 'editline' && $line->id == $lineid) $form->select_produits($line->fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
|
||||
else print $productstatic->getNomUrl(1).' - '.$productstatic->label;
|
||||
print '</td>';
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
if ($action === 'editline' && $line->id == $lineid) print '<input type="text" value="'.$line->batch.'" name="batch" class="flat maxwidth50"/>';
|
||||
else {
|
||||
@ -883,7 +883,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$form->select_produits($fk_product, 'fk_product', $filtertype, $limit, 0, -1, 2, '', 0, array(), 0, 0, 0, 'minwidth200imp maxwidth300', 1);
|
||||
print '</td>';
|
||||
// Batch number
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
print '<td>';
|
||||
print '<input type="text" name="batch" class="flat maxwidth50" '.(!empty($error) ? 'value="'.$batch.'"' : '').'>';
|
||||
print '</td>';
|
||||
|
||||
@ -264,12 +264,12 @@ if ($action == 'edit') {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>';
|
||||
$doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor("other-$key", $object->multilangs[$key]["other"], '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -335,13 +335,13 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
// Other field (not used)
|
||||
if (!empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) {
|
||||
print '<tr><td class="tdtop">'.$langs->trans('Other').' ('.$langs->trans("NotUsed").'</td><td>';
|
||||
$doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('other', '', '', 160, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -996,7 +996,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
$doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
|
||||
$doleditor = new DolEditor('description', $object->description, '', 90, 'dolibarr_notes', '', false, true, getDolGlobalInt('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -86,8 +86,33 @@ class Project extends CommonObject
|
||||
*/
|
||||
public $title;
|
||||
|
||||
/**
|
||||
* @var int Date start
|
||||
* @deprecated
|
||||
* @see $date_start
|
||||
*/
|
||||
public $dateo;
|
||||
|
||||
/**
|
||||
* @var int Date start
|
||||
*/
|
||||
public $date_start;
|
||||
|
||||
/**
|
||||
* @var int Date end
|
||||
* @deprecated
|
||||
* @see $date_end
|
||||
*/
|
||||
public $datee;
|
||||
|
||||
/**
|
||||
* @var int Date end
|
||||
*/
|
||||
public $date_end;
|
||||
|
||||
/**
|
||||
* @var int Date close
|
||||
*/
|
||||
public $date_close;
|
||||
|
||||
public $socid; // To store id of thirdparty
|
||||
@ -694,12 +719,12 @@ class Project extends CommonObject
|
||||
* @param string $type 'propal','order','invoice','order_supplier','invoice_supplier',...
|
||||
* @param string $tablename name of table associated of the type
|
||||
* @param string $datefieldname name of date field for filter
|
||||
* @param int $dates Start date
|
||||
* @param int $datee End date
|
||||
* @param int $date_start Start date
|
||||
* @param int $date_end End date
|
||||
* @param string $projectkey Equivalent key to fk_projet for actual type
|
||||
* @return mixed Array list of object ids linked to project, < 0 or string if error
|
||||
*/
|
||||
public function get_element_list($type, $tablename, $datefieldname = '', $dates = '', $datee = '', $projectkey = 'fk_projet')
|
||||
public function get_element_list($type, $tablename, $datefieldname = '', $date_start = '', $date_end = '', $projectkey = 'fk_projet')
|
||||
{
|
||||
// phpcs:enable
|
||||
|
||||
@ -729,28 +754,28 @@ class Project extends CommonObject
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")";
|
||||
}
|
||||
|
||||
if ($dates > 0 && $type == 'loan') {
|
||||
$sql .= " AND (dateend > '".$this->db->idate($dates)."' OR dateend IS NULL)";
|
||||
} elseif ($dates > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if ($date_start > 0 && $type == 'loan') {
|
||||
$sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)";
|
||||
} elseif ($date_start > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if (empty($datefieldname) && !empty($this->table_element_date)) {
|
||||
$datefieldname = $this->table_element_date;
|
||||
}
|
||||
if (empty($datefieldname)) {
|
||||
return 'Error this object has no date field defined';
|
||||
}
|
||||
$sql .= " AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)";
|
||||
$sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)";
|
||||
}
|
||||
|
||||
if ($datee > 0 && $type == 'loan') {
|
||||
$sql .= " AND (datestart < '".$this->db->idate($datee)."' OR datestart IS NULL)";
|
||||
} elseif ($datee > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if ($date_end > 0 && $type == 'loan') {
|
||||
$sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)";
|
||||
} elseif ($date_end > 0 && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table
|
||||
if (empty($datefieldname) && !empty($this->table_element_date)) {
|
||||
$datefieldname = $this->table_element_date;
|
||||
}
|
||||
if (empty($datefieldname)) {
|
||||
return 'Error this object has no date field defined';
|
||||
}
|
||||
$sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)";
|
||||
$sql .= " AND (".$datefieldname." <= '".$this->db->idate($date_end)."' OR ".$datefieldname." IS NULL)";
|
||||
}
|
||||
|
||||
$parameters = array(
|
||||
@ -758,8 +783,8 @@ class Project extends CommonObject
|
||||
'type' => $type,
|
||||
'tablename' => $tablename,
|
||||
'datefieldname' => $datefieldname,
|
||||
'dates' => $dates,
|
||||
'datee' => $datee,
|
||||
'dates' => $date_start,
|
||||
'datee' => $date_end,
|
||||
'fk_projet' => $projectkey,
|
||||
'ids' => $ids,
|
||||
);
|
||||
|
||||
@ -729,16 +729,21 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
// Project
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print img_picto('', 'project');
|
||||
$formother->selectProjectTasks(GETPOST('task_parent'), !empty($projectid) ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
|
||||
$formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx');
|
||||
print '</td></tr>';
|
||||
|
||||
$contactsofproject = (empty($object->id) ? '' : $object->getListContactId('internal'));
|
||||
|
||||
// Assigned to
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
$contactsofproject = (!empty($object->id) ? $object->getListContactId('internal') : '');
|
||||
if (is_array($contactsofproject) && count($contactsofproject)) {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoUserAssignedToTheProject").'</span>';
|
||||
if ($projectid > 0 || $object->id > 0) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoUserAssignedToTheProject").'</span>';
|
||||
} else {
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
@ -1244,7 +1244,7 @@ if ($action == 'create') {
|
||||
if (!empty($extrafields)) {
|
||||
//var_dump($line);
|
||||
$colspan = 5;
|
||||
if ($conf->productbatch->enabled) {
|
||||
if (isModEnabled('productbatch')) {
|
||||
$colspan += 3;
|
||||
}
|
||||
$recLine = new CommandeFournisseurDispatch($db);
|
||||
|
||||
@ -600,7 +600,7 @@ class Reception extends CommonObject
|
||||
$inventorycode = '';
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), '', '', '', '', 0, $inventorycode);
|
||||
|
||||
if ($result < 0) {
|
||||
if (intval($result) < 0) {
|
||||
$error++;
|
||||
$this->errors[] = $mouvS->error;
|
||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||
@ -614,7 +614,7 @@ class Reception extends CommonObject
|
||||
$inventorycode = '';
|
||||
$result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, $qty, $obj->cost_price, $langs->trans("ReceptionValidatedInDolibarr", $numref), $this->db->jdate($obj->eatby), $this->db->jdate($obj->sellby), $obj->batch, '', 0, $inventorycode);
|
||||
|
||||
if ($result < 0) {
|
||||
if (intval($result) < 0) {
|
||||
$error++;
|
||||
$this->errors[] = $mouvS->error;
|
||||
$this->errors = array_merge($this->errors, $mouvS->errors);
|
||||
|
||||
@ -229,7 +229,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -250,7 +250,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -226,7 +226,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->$key.'"></td></tr>';
|
||||
print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
@ -247,7 +247,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="oddeven"><td>';
|
||||
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
|
||||
print $form->textwithpicto($langs->trans($key), $tooltiphelp);
|
||||
print '</td><td>'.$conf->global->$key.'</td></tr>';
|
||||
print '</td><td>'.getDolGlobalString($key).'</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -110,11 +110,11 @@ class RecruitmentCandidature extends CommonObject
|
||||
public $fields = array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of candidature"),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of candidature", 'csslist'=>'nowraponall'),
|
||||
'fk_recruitmentjobposition' => array('type'=>'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'picto'=>'recruitmentjobposition', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'minwidth125 tdoverflowmax200'),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>1,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
|
||||
|
||||
@ -97,7 +97,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (!$sortfield) {
|
||||
$sortfield = "t.ref"; // Set here default search field. By default 1st field in definition.
|
||||
$sortfield = "t.date_creation"; // Set here default search field. By default 1st field in definition.
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "DESC";
|
||||
|
||||
@ -558,7 +558,7 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['nbapplications']['checked'])) {
|
||||
print '<th class="liste_titre right">'.$langs->trans("Applications").'</th>';
|
||||
print '<th class="liste_titre right">'.$langs->trans("RecruitmentCandidatures").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
// Action column
|
||||
|
||||
@ -122,7 +122,7 @@ foreach ($list as $key) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.$conf->global->$key.'">';
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -486,7 +486,7 @@ class PaymentSalary extends CommonObject
|
||||
*/
|
||||
public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
// Clean data
|
||||
$this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -94,6 +94,10 @@ class Salary extends CommonObject
|
||||
*/
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* 1 if salary paid COMPLETELY, 0 otherwise (do not use it anymore, use statut and close_code)
|
||||
*/
|
||||
public $paye;
|
||||
|
||||
const STATUS_UNPAID = 0;
|
||||
const STATUS_PAID = 1;
|
||||
@ -218,8 +222,6 @@ class Salary extends CommonObject
|
||||
$sql .= " s.fk_user_author,";
|
||||
$sql .= " s.fk_user_modif,";
|
||||
$sql .= " s.fk_account";
|
||||
/*$sql .= " b.fk_type,";
|
||||
$sql .= " b.rappro";*/
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."salary as s";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||
@ -231,28 +233,26 @@ class Salary extends CommonObject
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->tms = $this->db->jdate($obj->tms);
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->fk_user = $obj->fk_user;
|
||||
$this->datep = $this->db->jdate($obj->datep);
|
||||
$this->datev = $this->db->jdate($obj->datev);
|
||||
$this->amount = $obj->amount;
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->type_payment = $obj->fk_typepayment;
|
||||
$this->amount = $obj->amount;
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->type_payment = $obj->fk_typepayment;
|
||||
$this->label = $obj->label;
|
||||
$this->datesp = $this->db->jdate($obj->datesp);
|
||||
$this->dateep = $this->db->jdate($obj->dateep);
|
||||
$this->note = $obj->note;
|
||||
$this->paye = $obj->paye;
|
||||
$this->fk_bank = $obj->fk_bank;
|
||||
$this->fk_user_author = $obj->fk_user_author;
|
||||
$this->fk_user_modif = $obj->fk_user_modif;
|
||||
$this->fk_account = $this->accountid = $obj->fk_account;
|
||||
$this->fk_type = $obj->fk_type;
|
||||
$this->rappro = $obj->rappro;
|
||||
$this->fk_bank = $obj->fk_bank;
|
||||
$this->fk_user_author = $obj->fk_user_author;
|
||||
$this->fk_user_modif = $obj->fk_user_modif;
|
||||
$this->fk_account = $this->accountid = $obj->fk_account;
|
||||
|
||||
// Retreive all extrafield
|
||||
// Retrieve all extrafield
|
||||
// fetch optionals attributes and labels
|
||||
$this->fetch_optionals();
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -90,22 +90,10 @@ $search_date_end_to = dol_mktime(23, 59, 59, GETPOST('search_date_end_tomonth',
|
||||
$search_amount = GETPOST('search_amount', 'alpha');
|
||||
$search_account = GETPOST('search_account', 'int');
|
||||
$search_status = GETPOST('search_status', 'int');
|
||||
$search_type_id = GETPOST('search_type_id', 'int');
|
||||
|
||||
$filtre = GETPOST("filtre", 'restricthtml');
|
||||
|
||||
if (!GETPOST('search_type_id', 'int')) {
|
||||
$newfiltre = str_replace('filtre=', '', $filtre);
|
||||
$filterarray = explode('-', $newfiltre);
|
||||
foreach ($filterarray as $val) {
|
||||
$part = explode(':', $val);
|
||||
if ($part[0] == 's.fk_typepayment') {
|
||||
$search_type_id = $part[1];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$search_type_id = GETPOST('search_type_id', 'int');
|
||||
}
|
||||
|
||||
$childids = $user->getAllChildIds(1);
|
||||
|
||||
// Initialize array of search criterias
|
||||
@ -519,6 +507,9 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
|
||||
$i = 0;
|
||||
$total = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val'] = array();
|
||||
$totalarray['val']['totalttcfield'] = 0;
|
||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
/* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
*
|
||||
* 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
|
||||
@ -391,7 +391,9 @@ if (!empty($socid)) {
|
||||
}
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('NewSalaryPayment'), '', 'fa fa-plus-circle', $url, '', $user->rights->salaries->write);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_payment', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
//$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
@ -192,10 +192,10 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
|
||||
print '</td><td>';
|
||||
$variablename = 'TAKEPOS_HEADER';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
@ -205,10 +205,10 @@ if ($conf->global->TAKEPOS_PRINT_METHOD == "browser" || $conf->global->TAKEPOS_P
|
||||
print '</td><td>';
|
||||
$variablename = 'TAKEPOS_FOOTER';
|
||||
if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
|
||||
print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
|
||||
} else {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
|
||||
$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
|
||||
print $doleditor->Create();
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
||||
@ -1045,6 +1045,7 @@ div.divsearchfield {
|
||||
overflow: auto;
|
||||
padding-bottom: 5px;
|
||||
opacity: 0.6;
|
||||
font-size: small;
|
||||
}
|
||||
.divadvancedsearchfield:first-child {
|
||||
margin-top: 3px;
|
||||
@ -4817,7 +4818,7 @@ div#card-errors {
|
||||
color: #fa755a;
|
||||
text-align: center;
|
||||
padding-top: 3px;
|
||||
max-width: 320px;
|
||||
/* max-width: 320px; */
|
||||
}
|
||||
|
||||
|
||||
@ -7615,6 +7616,14 @@ div.clipboardCPValue.hidewithsize {
|
||||
/* border-bottom: 2px solid var(--colorbackhmenu1) !important; */
|
||||
border-bottom: 1px solid var(--colortopbordertitle1) !important;
|
||||
}
|
||||
|
||||
div#card-errors {
|
||||
max-width: unset;
|
||||
}
|
||||
|
||||
#dolpaymenttable {
|
||||
padding: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 320px)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user