Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into pr/bb2a/21596
This commit is contained in:
commit
31c7385dd7
@ -2,6 +2,7 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
|
||||
|
||||
For users:
|
||||
@ -25,9 +26,10 @@ WARNING:
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
|
||||
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
|
||||
* All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead
|
||||
* Code standardization: $user->rights->propale is now $user->rights->propal everywhere.
|
||||
* All functions fetch_all() have been set to deprecated for naming consitency, use fetchAll() instead.
|
||||
* Code standardization: '$user->rights->propale' is now '$user->rights->propal' everywhere.
|
||||
* Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead.
|
||||
* Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande.
|
||||
|
||||
|
||||
***** ChangeLog for 16.0.1 compared to 16.0.0 *****
|
||||
|
||||
@ -718,9 +718,12 @@ class AccountancyExport
|
||||
|
||||
/**
|
||||
* Export format : WinFic - eWinfic - WinSis Compta
|
||||
* Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf
|
||||
*
|
||||
* @param array $TData data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportWinfic(&$TData)
|
||||
@ -728,10 +731,14 @@ class AccountancyExport
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
$index = 1;
|
||||
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
|
||||
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account)) {
|
||||
@ -740,7 +747,7 @@ class AccountancyExport
|
||||
|
||||
$Tab = array();
|
||||
//$Tab['type_ligne'] = 'M';
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2);
|
||||
|
||||
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||
@ -749,11 +756,11 @@ class AccountancyExport
|
||||
|
||||
$Tab['folio'] = ' 1';
|
||||
|
||||
$Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
|
||||
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0');
|
||||
$Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0');
|
||||
|
||||
if ($data->sens == 'D') {
|
||||
$Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
@ -765,11 +772,11 @@ class AccountancyExport
|
||||
$Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30);
|
||||
$Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30);
|
||||
|
||||
$Tab['lettrage'] = str_repeat(' ', 2);
|
||||
$Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2);
|
||||
|
||||
$Tab['code_piece'] = str_repeat(' ', 5);
|
||||
$Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT);
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
@ -793,6 +800,8 @@ class AccountancyExport
|
||||
$Tab['end_line'] = $end_line;
|
||||
|
||||
print implode('|', $Tab);
|
||||
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -370,7 +370,11 @@ if (!empty($searchCategoryContactList)) {
|
||||
if (intval($searchCategoryContact) == -2) {
|
||||
$searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member)";
|
||||
} elseif (intval($searchCategoryContact) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
|
||||
if ($searchCategoryContactOperator == 0) {
|
||||
$searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_categorie FROM ".MAIN_DB_PREFIX."categorie_member as ck WHERE d.rowid = ck.fk_member AND ck.fk_categorie = ".((int) $searchCategoryContact).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
|
||||
@ -40,7 +40,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ if ($user->socid > 0) {
|
||||
}
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$year = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
|
||||
@ -288,7 +288,7 @@ if ($rowid && $action != 'edit') {
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Member
|
||||
$adh->ref = $adh->getFullName($langs);
|
||||
@ -320,7 +320,7 @@ if ($rowid && $action != 'edit') {
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur">'.price($object->amount).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur"><span class="amount">'.price($object->amount).'</span></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||
|
||||
@ -182,7 +182,39 @@ if ($action == 'updateMask') {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') {
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
/*elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') {
|
||||
// Activate ask for payment bank
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@ -208,7 +240,8 @@ if ($action == 'updateMask') {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@ -636,6 +669,13 @@ print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMAR
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
print '</form>';
|
||||
|
||||
/*
|
||||
|
||||
@ -55,6 +55,8 @@ if (empty($conf->global->CONTRACT_ADDON)) {
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$error=0;
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconstcontract', 'alpha');
|
||||
$maskvalue = GETPOST('maskcontract', 'alpha');
|
||||
@ -158,10 +160,37 @@ if ($action == 'updateMask') {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 0, 'int', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif ($action == "allowexternaldownload") {
|
||||
if (!dolibarr_set_const($db, "CONTRACT_ALLOW_EXTERNAL_DOWNLOAD", $value, 0, 'int', $conf->entity)) {
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -504,16 +533,8 @@ print '</tr>';
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center">';
|
||||
if ($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowexternaldownload&token='.newToken().'&value=0">';
|
||||
print img_picto($langs->trans("Activited"), 'switch_on');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowexternaldownload&token='.newToken().'&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
@ -232,6 +232,37 @@ if ($action == 'updateMask') {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -771,20 +802,15 @@ print '</form>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("InvoiceCheckPosteriorDate"). ' ' ;
|
||||
print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help') . '</td>';
|
||||
print '<td class="left">';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE');
|
||||
} else {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="action" value="set_INVOICE_CHECK_POSTERIOR_DATE" />';
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_CHECK_POSTERIOR_DATE", $arrval, $conf->global->INVOICE_CHECK_POSTERIOR_DATE);
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'" />';
|
||||
print '</form>';
|
||||
}
|
||||
print '<td class="left" colspan="2">';
|
||||
print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE');
|
||||
print '</td></tr>';
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="left" colspan="2">';
|
||||
print ajax_constantonoff('INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -625,6 +625,15 @@ print '<td class="right"><input type="submit" class="button button-edit" value="
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
|
||||
print '<td class="center" colspan="2">';
|
||||
print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// default update prices on cloning a proposal
|
||||
/*
|
||||
print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
@ -178,6 +178,37 @@ if ($action == 'set') {
|
||||
// par appel methode canBeActivated
|
||||
|
||||
dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
} elseif (preg_match('/set_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$value = (GETPOST($code) ? GETPOST($code) : 1);
|
||||
|
||||
$res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
} elseif (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
$code = $reg[1];
|
||||
$res = dolibarr_del_const($db, $code, $conf->entity);
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($langs->trans('Error'), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"]);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -502,21 +533,20 @@ print '</form>';
|
||||
if (isModEnabled('banque')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td class="right">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
|
||||
} else {
|
||||
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=1">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} else {
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=0">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
}
|
||||
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
|
||||
print '</td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td> </td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
|
||||
}
|
||||
|
||||
// Allow external download
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("AllowExternalDownload").'</td><td> </td>';
|
||||
print '<td class="right">';
|
||||
print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@ -612,10 +612,10 @@ class Setup extends DolibarrApi
|
||||
* @param object $object Object with label to translate
|
||||
* @param string $lang Code of the language the name of the object must be translated to
|
||||
* @param string $prefix Prefix for translation key
|
||||
*
|
||||
* @param array $dict Array of dictionnary for translation
|
||||
* @return void
|
||||
*/
|
||||
private function translateLabel($object, $lang, $prefix = 'Country')
|
||||
private function translateLabel($object, $lang, $prefix = 'Country', $dict = array('dict'))
|
||||
{
|
||||
if (!empty($lang)) {
|
||||
// Load the translations if this is a new language.
|
||||
@ -623,7 +623,7 @@ class Setup extends DolibarrApi
|
||||
global $conf;
|
||||
$this->translations = new Translate('', $conf);
|
||||
$this->translations->setDefaultLang($lang);
|
||||
$this->translations->load('dict');
|
||||
$this->translations->loadLangs($dict);
|
||||
}
|
||||
if ($object->code) {
|
||||
$key = $prefix.$object->code;
|
||||
@ -636,7 +636,6 @@ class Setup extends DolibarrApi
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of events types.
|
||||
*
|
||||
@ -779,6 +778,7 @@ class Setup extends DolibarrApi
|
||||
* @param string $type To filter on type of contact
|
||||
* @param string $module To filter on module contacts
|
||||
* @param int $active Contact's type is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the civility must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of Contacts types
|
||||
*
|
||||
@ -786,7 +786,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $sqlfilters = '')
|
||||
public function getListOfContactTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -827,7 +827,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$contact_type = $this->db->fetch_object($result);
|
||||
$this->translateLabel($contact_type, $lang, 'TypeContact_'.$contact_type->type.'_'.$contact_type->source.'_', array("eventorganization", "resource", "projects", "contracts", "bills", "orders", "agenda", "propal", "stocks", "supplier_proposal", "interventions", "sendings", "ticket"));
|
||||
$list[] = $contact_type;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of contacts types : '.$this->db->lasterror());
|
||||
@ -845,6 +847,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param string $module To filter on module events
|
||||
* @param int $active Civility is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the civility must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of civility types
|
||||
*
|
||||
@ -852,7 +855,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $sqlfilters = '')
|
||||
public function getListOfCivilities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $module = '', $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -890,7 +893,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$civility = $this->db->fetch_object($result);
|
||||
$this->translateLabel($civility, $lang, 'Civility', array('dict'));
|
||||
$list[] = $civility;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of civility : '.$this->db->lasterror());
|
||||
@ -1188,6 +1193,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number {@min 0}
|
||||
* @param int $active Shipping methodsm is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the method must be translated to
|
||||
* @param string $sqlfilters SQL criteria to filter. Syntax example "(t.code:=:'CHQ')"
|
||||
*
|
||||
* @url GET dictionary/shipping_methods
|
||||
@ -1196,7 +1202,7 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 400
|
||||
*/
|
||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getShippingModes($limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
@ -1232,7 +1238,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$method = $this->db->fetch_object($result);
|
||||
$this->translateLabel($method, $lang, '', array('dict'));
|
||||
$list[] = $method;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(400, $this->db->lasterror());
|
||||
@ -1496,6 +1504,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the category must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket categories
|
||||
*
|
||||
@ -1503,13 +1512,14 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsCategories($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_category').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1538,7 +1548,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$category = $this->db->fetch_object($result);
|
||||
$this->translateLabel($category, $lang, 'TicketCategoryShort', array('ticket'));
|
||||
$list[] = $category;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket categories : '.$this->db->lasterror());
|
||||
@ -1555,6 +1567,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the severity must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket severities
|
||||
*
|
||||
@ -1562,13 +1575,14 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsSeverities($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, color, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity as t";
|
||||
$sql .= " WHERE t.active = ".((int) $active);
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_severity').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1597,7 +1611,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$severity = $this->db->fetch_object($result);
|
||||
$this->translateLabel($severity, $lang, 'TicketSeverityShort', array('ticket'));
|
||||
$list[] = $severity;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket severities : '.$this->db->lasterror());
|
||||
@ -1614,6 +1630,7 @@ class Setup extends DolibarrApi
|
||||
* @param int $limit Number of items per page
|
||||
* @param int $page Page number (starting from zero)
|
||||
* @param int $active Payment term is active or not {@min 0} {@max 1}
|
||||
* @param string $lang Code of the language the label of the type must be translated to
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.code:like:'A%') and (t.active:>=:0)"
|
||||
* @return array List of ticket types
|
||||
*
|
||||
@ -1621,15 +1638,15 @@ class Setup extends DolibarrApi
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||
public function getTicketsTypes($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $lang = '', $sqlfilters = '')
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$sql = "SELECT rowid, code, pos, label, use_default, description";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type as t";
|
||||
$sql .= " WHERE t.active = ".(int) $active;
|
||||
// if ($type) $sql .= " AND t.type LIKE '%".$this->db->escape($type)."%'";
|
||||
// if ($module) $sql .= " AND t.module LIKE '%".$this->db->escape($module)."%'";
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_ticket_type').")";
|
||||
$sql .= " AND t.active = ".((int) $active);
|
||||
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
$errormessage = '';
|
||||
@ -1658,7 +1675,9 @@ class Setup extends DolibarrApi
|
||||
$num = $this->db->num_rows($result);
|
||||
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||
for ($i = 0; $i < $min; $i++) {
|
||||
$list[] = $this->db->fetch_object($result);
|
||||
$type =$this->db->fetch_object($result);
|
||||
$this->translateLabel($type, $lang, 'TicketTypeShort', array('ticket'));
|
||||
$list[] = $type;
|
||||
}
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieving list of ticket types : '.$this->db->lasterror());
|
||||
|
||||
@ -704,7 +704,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=bom', 'clone', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Close / Cancel
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -186,7 +186,7 @@ if ($action == 'create') {
|
||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||
|
||||
// Owner
|
||||
// Visibility / Owner
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
print '</td><td class="hideonsmartphone"></td></tr>';
|
||||
@ -279,9 +279,10 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility / owner
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($action == 'edit' && $user->admin) {
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
} else {
|
||||
if ($object->fk_user > 0) {
|
||||
$fuser = new User($db);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -39,13 +39,14 @@ $id = GETPOST("id", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -72,6 +73,14 @@ $permissiontodelete = !empty($user->rights->bookmark->supprimer);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
$res = $object->remove($id);
|
||||
if ($res > 0) {
|
||||
@ -103,34 +112,41 @@ if (!$user->admin) {
|
||||
$sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
|
||||
}
|
||||
|
||||
$sql .= $db->order($sortfield.", position", $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
||||
$num = $nbtotalofrecords;
|
||||
} else {
|
||||
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield.", position", $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
}
|
||||
|
||||
$param = "";
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$param = '';
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -138,7 +154,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param = '&optioncss='.urlencode($optioncss);
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
@ -150,7 +166,7 @@ $arrayofmassactions = array(
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
@ -158,7 +174,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@ -167,7 +183,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
|
||||
@ -179,13 +197,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
//print "<td> </td>";
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -205,33 +223,31 @@ while ($i < min($num, $limit)) {
|
||||
print $object->getNomUrl(1);
|
||||
print '</td>';
|
||||
|
||||
$linkintern = 0;
|
||||
$linkintern = 1;
|
||||
if (preg_match('/^http/i', $obj->url)) {
|
||||
$linkintern = 0;
|
||||
}
|
||||
$title = $obj->title;
|
||||
$link = $obj->url;
|
||||
$canedit = $user->rights->bookmark->supprimer;
|
||||
$candelete = $user->rights->bookmark->creer;
|
||||
|
||||
// Title
|
||||
print "<td>";
|
||||
$linkintern = 1;
|
||||
if ($linkintern) {
|
||||
print '<a href="'.$obj->url.'">';
|
||||
}
|
||||
print $title;
|
||||
if ($linkintern) {
|
||||
print "</a>";
|
||||
}
|
||||
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
||||
print dol_escape_htmltag($title);
|
||||
print "</td>\n";
|
||||
|
||||
// Url
|
||||
print '<td class="tdoverflowmax200">';
|
||||
if (!$linkintern) {
|
||||
print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
if (empty($linkintern)) {
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
|
||||
} else {
|
||||
//print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
|
||||
print '<a class="" href="'.$obj->url.'">';
|
||||
}
|
||||
print $link;
|
||||
if (!$linkintern) {
|
||||
print '</a>';
|
||||
}
|
||||
print '</a>';
|
||||
print "</td>\n";
|
||||
|
||||
// Target
|
||||
@ -264,7 +280,7 @@ while ($i < min($num, $limit)) {
|
||||
print "</td>\n";
|
||||
|
||||
// Date creation
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
|
||||
|
||||
// Position
|
||||
print '<td class="right">'.$obj->position."</td>";
|
||||
|
||||
@ -1152,6 +1152,7 @@ class Categorie extends CommonObject
|
||||
$this->cats[$obj->rowid]['color'] = $obj->color;
|
||||
$this->cats[$obj->rowid]['visible'] = $obj->visible;
|
||||
$this->cats[$obj->rowid]['ref_ext'] = $obj->ref_ext;
|
||||
$this->cats[$obj->rowid]['picto'] = 'category';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -2148,6 +2148,15 @@ if ($id > 0) {
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewPerUser").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$linkback .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$linkback = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
//$linkback.=$out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -63,6 +63,9 @@ if ($id > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('actioncard', 'globalcard'));
|
||||
|
||||
// Get parameters
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
@ -155,6 +158,15 @@ if ($object->id > 0) {
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -39,6 +39,9 @@ $langs->load("commercial");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('actioncard', 'globalcard'));
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
$action = '';
|
||||
@ -83,6 +86,15 @@ $out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.do
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
|
||||
@ -131,7 +131,6 @@ $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown
|
||||
// Security check
|
||||
if (!empty($user->socid)) {
|
||||
$socid = $user->socid;
|
||||
$object->id = $user->socid;
|
||||
}
|
||||
restrictedArea($user, 'propal', $object->id);
|
||||
|
||||
@ -1792,13 +1791,13 @@ if ($action == 'create') {
|
||||
// Terms of payment
|
||||
print '<tr class="field_cond_reglement_id"><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
print img_picto('', 'paiment');
|
||||
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
|
||||
print $form->getSelectConditionsPaiements((GETPOSTISSET('cond_reglement_id') && GETPOST('cond_reglement_id', 'int') != 0) ? GETPOST('cond_reglement_id', 'int') : $soc->cond_reglement_id, 'cond_reglement_id', 1, 1, 0, '', (GETPOSTISSET('cond_reglement_id_deposit_percent') ? GETPOST('cond_reglement_id_deposit_percent', 'alpha') : $soc->deposit_percent));
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode of payment
|
||||
print '<tr class="field_mode_reglement_id"><td class="titlefieldcreate">'.$langs->trans('PaymentMode').'</td><td class="valuefieldcreate">';
|
||||
print img_picto('', 'bank', 'class="pictofixedwidth"');
|
||||
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
@ -2004,8 +2003,8 @@ if ($action == 'create') {
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
$propalRefAndSocName = $row [1]." - ".$row [2];
|
||||
$liste_propal [$row [0]] = $propalRefAndSocName;
|
||||
$propalRefAndSocName = $row[1]." - ".$row[2];
|
||||
$liste_propal[$row[0]] = $propalRefAndSocName;
|
||||
$i++;
|
||||
}
|
||||
print $form->selectarray("copie_propal", $liste_propal, 0);
|
||||
|
||||
@ -50,6 +50,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
if (isModEnabled('categorie')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
|
||||
@ -462,7 +466,7 @@ if ($action == "nosign" && $permissiontoclose) {
|
||||
$error = 0;
|
||||
foreach ($toselect as $checked) {
|
||||
if ($tmpproposal->fetch($checked) > 0) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED) {
|
||||
if ($tmpproposal->statut == $tmpproposal::STATUS_VALIDATED || (!empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $tmpproposal->statut == $tmpproposal::STATUS_DRAFT)) {
|
||||
$tmpproposal->statut = $tmpproposal::STATUS_NOTSIGNED;
|
||||
if ($tmpproposal->closeProposal($user, $tmpproposal::STATUS_NOTSIGNED) > 0) {
|
||||
setEventMessage($tmpproposal->ref." ".$langs->trans('NoSigned'), 'mesgs');
|
||||
@ -548,7 +552,7 @@ $help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
if ($sall || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax , s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, ';
|
||||
@ -592,12 +596,9 @@ $sql .= ', '.MAIN_DB_PREFIX.'propal as p';
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)";
|
||||
}
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
}
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)";
|
||||
@ -710,10 +711,6 @@ if ($search_fk_input_reason > 0) {
|
||||
if ($search_fk_mode_reglement > 0) {
|
||||
$sql .= " AND p.fk_mode_reglement = ".((int) $search_fk_mode_reglement);
|
||||
}
|
||||
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND s.rowid = '.((int) $socid);
|
||||
}
|
||||
@ -750,6 +747,36 @@ if ($search_date_signature_start) {
|
||||
if ($search_date_signature_end) {
|
||||
$sql .= " AND p.date_signature <= '".$db->idate($search_date_signature_end)."'";
|
||||
}
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductOperator = -1;
|
||||
$searchCategoryProductList = array($search_product_category);
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."propaldet as pd WHERE pd.fk_propal = p.rowid AND pd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
} else {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
@ -1080,13 +1107,12 @@ if ($resql) {
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
// If the user can view products
|
||||
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||
if (isModEnabled('categorie') && $user->hasRight('categorie', 'read') && ($user->rights->produit->lire || $user->rights->service->lire)) {
|
||||
$searchCategoryProductOperator = -1;
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('IncludingProductWithTag');
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300 widthcentpercentminusx' : 'maxwidth250 widthcentpercentminusx'), 1);
|
||||
$moreforfilter .= '</div>';
|
||||
$formcategory = new FormCategory($db);
|
||||
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle);
|
||||
}
|
||||
if (isModEnabled('categorie') && $user->rights->categorie->lire) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
@ -1661,6 +1687,9 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['p.ref']['checked'])) {
|
||||
@ -2205,10 +2234,11 @@ if ($resql) {
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -793,7 +793,7 @@ $title = $langs->trans("Orders");
|
||||
$help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
if ($sall || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client,';
|
||||
@ -837,12 +837,9 @@ $sql .= ', '.MAIN_DB_PREFIX.'commande as c';
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)";
|
||||
}
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON c.rowid=pd.fk_commande';
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = c.fk_projet";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON c.fk_user_author = u.rowid';
|
||||
|
||||
@ -862,9 +859,6 @@ $sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= ' WHERE c.fk_soc = s.rowid';
|
||||
$sql .= ' AND c.entity IN ('.getEntity('commande').')';
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||
}
|
||||
if ($socid > 0) {
|
||||
$sql .= ' AND s.rowid = '.((int) $socid);
|
||||
}
|
||||
@ -1007,7 +1001,36 @@ if ($search_fk_mode_reglement > 0) {
|
||||
if ($search_fk_input_reason > 0) {
|
||||
$sql .= " AND c.fk_input_reason = ".((int) $search_fk_input_reason);
|
||||
}
|
||||
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductOperator = -1;
|
||||
$searchCategoryProductList = array($search_product_category);
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
} else {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
@ -1950,6 +1973,10 @@ if ($resql) {
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Ref
|
||||
@ -2192,7 +2219,11 @@ if ($resql) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_tva';
|
||||
}
|
||||
$totalarray['val']['c.total_tva'] += $obj->total_tva;
|
||||
if (isset($totalarray['val']['c.total_tva'])) {
|
||||
$totalarray['val']['c.total_tva'] += $obj->total_tva;
|
||||
} else {
|
||||
$totalarray['val']['c.total_tva'] = $obj->total_tva;
|
||||
}
|
||||
}
|
||||
|
||||
// Amount TTC / gross
|
||||
@ -2204,7 +2235,11 @@ if ($resql) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_ttc';
|
||||
}
|
||||
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
||||
if (isset($totalarray['val']['c.total_ttc'])) {
|
||||
$totalarray['val']['c.total_ttc'] += $obj->total_ttc;
|
||||
} else {
|
||||
$totalarray['val']['c.total_ttc'] = $obj->total_ttc;
|
||||
}
|
||||
}
|
||||
|
||||
// Currency
|
||||
@ -2565,10 +2600,10 @@ if ($resql) {
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -65,7 +65,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -222,7 +222,11 @@ if (!empty($searchCategoryBankList)) {
|
||||
if (intval($searchCategoryBank) == -2) {
|
||||
$searchCategoryBankSqlList[] = "NOT EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account)";
|
||||
} elseif (intval($searchCategoryBank) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank);
|
||||
if ($searchCategoryBankOperator == 0) {
|
||||
$searchCategoryBankSqlList[] = " EXISTS (SELECT ck.fk_account FROM ".MAIN_DB_PREFIX."categorie_account as ck WHERE b.rowid = ck.fk_account AND ck.fk_categorie = ".((int) $searchCategoryBank).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryBank);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
|
||||
@ -62,7 +62,7 @@ if ($userid > 0) {
|
||||
}
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -559,7 +559,7 @@ $companyparent = new Societe($db);
|
||||
$company_url_list = array();
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
if ($sall || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' f.rowid as id, f.ref, f.ref_client, f.fk_soc, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.fk_cond_reglement, f.total_ht, f.total_tva, f.total_ttc,';
|
||||
@ -616,7 +616,7 @@ if (!$sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid';
|
||||
}
|
||||
*/
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture';
|
||||
}
|
||||
if (!empty($search_fac_rec_source_title)) {
|
||||
@ -811,13 +811,17 @@ if (!empty($searchCategoryProductList)) {
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)";
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture = f.rowid AND fd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
@ -839,7 +843,11 @@ if (!empty($searchCategoryCustomerList)) {
|
||||
if (intval($searchCategoryCustomer) == -2) {
|
||||
$searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
|
||||
} elseif (intval($searchCategoryCustomer) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
|
||||
if ($searchCategoryCustomerOperator == 0) {
|
||||
$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
@ -910,7 +918,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
*/
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
if ($sall || $search_user > 0) {
|
||||
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(DISTINCT f.rowid) as nbtotalofrecords FROM', $sql);
|
||||
} else {
|
||||
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(f.rowid) as nbtotalofrecords FROM', $sql);
|
||||
|
||||
@ -64,7 +64,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -68,9 +68,9 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-name nowraponall">'.$objectlink->getNomUrl(1).'</td>';
|
||||
print '<td class="linkedcol-ref left">'.$objectlink->ref_client.'</td>';
|
||||
print '<td class="linkedcol-ref tdoverflowmax150" title="'.dol_escape_htmltag($objectlink->ref_client).'">'.dol_escape_htmltag($objectlink->ref_client).'</td>';
|
||||
print '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
|
||||
print '<td class="linkedcol-amount right">';
|
||||
print '<td class="linkedcol-amount right nowraponall">';
|
||||
if (!empty($objectlink) && $objectlink->element == 'facture' && $user->hasRight('facture', 'lire')) {
|
||||
$sign = 1;
|
||||
if ($objectlink->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
|
||||
@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
?>
|
||||
<tr class="<?php echo $trclass; ?>" >
|
||||
<td class="linkedcol-element tdoverflowmax100"><?php echo $langs->trans("RepeatableInvoice"); ?></td>
|
||||
<td class="linkedcol-name"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-name tdoverflowmax150"><!-- nowraponall because ref is a label --><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td class="linkedcol-ref" align="center"></td>
|
||||
<td class="linkedcol-date" align="center"><?php echo dol_print_date($objectlink->date_when, 'day'); ?></td>
|
||||
<td class="linkedcol-amount right"><?php
|
||||
|
||||
@ -74,7 +74,7 @@ llxHeader('', $langs->trans("PurchasesJournal"), '', '', 0, 0, '', '', $morequer
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -77,7 +77,7 @@ $morequery = '&date_startyear='.$date_startyear.'&date_startmonth='.$date_startm
|
||||
llxHeader('', $langs->trans("SellsJournal"), '', '', 0, 0, '', '', $morequery);
|
||||
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -39,7 +39,7 @@ $local = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -38,7 +38,7 @@ $localTaxType = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -49,7 +49,7 @@ $local = GETPOST('localTaxType', 'int');
|
||||
// Date range
|
||||
$year = GETPOST("year", "int");
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year_start = $year_current;
|
||||
} else {
|
||||
$year_current = $year;
|
||||
|
||||
@ -59,7 +59,7 @@ $nbofyear = 1;
|
||||
// Date range
|
||||
$year = GETPOST('year', 'int');
|
||||
if (empty($year)) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$month_current = strftime("%m", dol_now());
|
||||
$year_start = $year_current - ($nbofyear - 1);
|
||||
} else {
|
||||
|
||||
@ -371,7 +371,7 @@ print '</tr>';
|
||||
$now_show_delta = 0;
|
||||
$minyear = substr($minyearmonth, 0, 4);
|
||||
$maxyear = substr($maxyearmonth, 0, 4);
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$nowyearmonth = strftime("%Y-%m", dol_now());
|
||||
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
|
||||
$now = dol_now();
|
||||
|
||||
@ -310,7 +310,7 @@ print '</tr>';
|
||||
$now_show_delta = 0;
|
||||
$minyear = substr($minyearmonth, 0, 4);
|
||||
$maxyear = substr($maxyearmonth, 0, 4);
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$nowyearmonth = strftime("%Y-%m", dol_now());
|
||||
$maxyearmonth = max($maxyearmonth, $nowyearmonth);
|
||||
$now = dol_now();
|
||||
|
||||
@ -438,7 +438,11 @@ if (!empty($searchCategoryContactList)) {
|
||||
if (intval($searchCategoryContact) == -2) {
|
||||
$searchCategoryContactSqlList[] = "NOT EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople)";
|
||||
} elseif (intval($searchCategoryContact) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
|
||||
if ($searchCategoryContactOperator == 0) {
|
||||
$searchCategoryContactSqlList[] = " EXISTS (SELECT ck.fk_socpeople FROM ".MAIN_DB_PREFIX."categorie_contact as ck WHERE s.rowid = ck.fk_socpeople AND ck.fk_categorie = ".((int) $searchCategoryContact).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryContact);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
@ -464,7 +468,11 @@ if (!empty($searchCategoryCustomerList)) {
|
||||
if (intval($searchCategoryCustomer) == -2) {
|
||||
$searchCategoryCustomerSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc)";
|
||||
} elseif (intval($searchCategoryCustomer) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
|
||||
if ($searchCategoryCustomerOperator == 0) {
|
||||
$searchCategoryCustomerSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategoryCustomer).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
@ -490,7 +498,11 @@ if (!empty($searchCategorySupplierList)) {
|
||||
if (intval($searchCategorySupplier) == -2) {
|
||||
$searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
|
||||
} elseif (intval($searchCategorySupplier) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
|
||||
if ($searchCategorySupplierOperator == 0) {
|
||||
$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
|
||||
@ -265,9 +265,6 @@ if (!empty($extrafields->attributes[$object->table_element]['label']) && is_arra
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product';
|
||||
}
|
||||
if ($search_user > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
@ -277,9 +274,6 @@ $sql .= ' AND c.entity IN ('.getEntity('contract').')';
|
||||
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||
$sql .= " AND s.fk_typent IN (".$db->sanitize($db->escape($search_type_thirdparty)).')';
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||
}
|
||||
if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
@ -325,6 +319,36 @@ if ($sall) {
|
||||
if ($search_user > 0) {
|
||||
$sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".((int) $search_user);
|
||||
}
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductOperator = -1;
|
||||
$searchCategoryProductList = array($search_product_category);
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."contratdet as cd WHERE cd.fk_contrat = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
} else {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
@ -378,8 +402,6 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
} else {
|
||||
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
|
||||
$sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'contratdet as cd ON c.rowid = cd.fk_contrat/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/AND cp.fk_categorie = '.((int) $search_product_category).'/', '', $sqlforcount);
|
||||
$sqlforcount = preg_replace('/GROUP BY.*$/', '', $sqlforcount);
|
||||
|
||||
$resql = $db->query($sqlforcount);
|
||||
|
||||
@ -435,7 +435,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
}
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
|
||||
$newlang = $object->thirdparty->default_lang;
|
||||
$newlang = !empty($object->thirdparty->default_lang) ? $object->thirdparty->default_lang : "";
|
||||
}
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
|
||||
@ -1240,6 +1240,50 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) {
|
||||
$db->begin();
|
||||
if (GETPOSTISSET('pricerate')) {
|
||||
$pricepercentage=GETPOST('pricerate', 'int');
|
||||
if ($pricepercentage == 0) {
|
||||
setEventMessages($langs->trans("RecordsModified", 0), null);
|
||||
} else {
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $object->fetch($toselectid);
|
||||
//var_dump($contcats);exit;
|
||||
if ($result > 0) {
|
||||
if ($obj->price_base_type == 'TTC') {
|
||||
$newprice = $object->price_ttc * (100 + $pricepercentage) / 100;
|
||||
$minprice = $object->price_min_ttc;
|
||||
} else {
|
||||
$newprice = $object->price * (100 + $pricepercentage) / 100;
|
||||
$minprice = $object->price_min;
|
||||
}
|
||||
$res = $object->updatePrice($newprice, $obj->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code);
|
||||
if ($res > 0) {
|
||||
$nbok++;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if ($nbok > 0) {
|
||||
setEventMessages($langs->trans("RecordsModified", $nbok), null);
|
||||
}
|
||||
$db->commit();
|
||||
$toselect=array();
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($action == 'setsupervisor' && $confirm == 'yes') && $permissiontoadd) {
|
||||
$db->begin();
|
||||
$supervisortoset=GETPOST('supervisortoset');
|
||||
|
||||
@ -2193,7 +2193,7 @@ abstract class CommonObject
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
}
|
||||
} else {
|
||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||
@ -2263,7 +2263,7 @@ abstract class CommonObject
|
||||
$sql .= " AND te.entity IS NOT NULL"; // Show all users
|
||||
} else {
|
||||
$sql .= " AND ug.fk_user = te.rowid";
|
||||
$sql .= " AND ug.entity IN (".getEntity($this->element).")";
|
||||
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
|
||||
}
|
||||
} else {
|
||||
$sql .= ' AND te.entity IN ('.getEntity($this->element).')';
|
||||
|
||||
@ -113,7 +113,8 @@ class EvalMath
|
||||
|
||||
// constants
|
||||
public $fb = array( // built-in functions
|
||||
'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval');
|
||||
'sin', 'sinh', 'arcsin', 'asin', 'arcsinh', 'asinh', 'cos', 'cosh', 'arccos', 'acos', 'arccosh', 'acosh', 'tan', 'tanh', 'arctan', 'atan', 'arctanh', 'atanh', 'sqrt', 'abs', 'ln', 'log', 'intval', 'ceil',
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -4859,7 +4859,7 @@ class Form
|
||||
* - int (id of category)
|
||||
* - string (categories ids seprated by comma)
|
||||
* - array (list of categories ids)
|
||||
* @param int $outputmode 0=HTML select string, 1=Array
|
||||
* @param int $outputmode 0=HTML select string, 1=Array, 2=Array extended
|
||||
* @param int $include [=0] Removed or 1=Keep only
|
||||
* @param string $morecss More CSS
|
||||
* @return string|array
|
||||
@ -4892,7 +4892,7 @@ class Form
|
||||
while ($i < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
if ($objp) {
|
||||
$cate_arbo[$objp->rowid] = array('id'=>$objp->rowid, 'fulllabel'=>$objp->label);
|
||||
$cate_arbo[$objp->rowid] = array('id'=>$objp->rowid, 'fulllabel'=>$objp->label, 'color'=>'', 'picto'=>'category');
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
@ -4905,8 +4905,9 @@ class Form
|
||||
$cate_arbo = $cat->get_full_arbo($type, $markafterid, $include);
|
||||
}
|
||||
|
||||
$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$outarray = array();
|
||||
|
||||
$output = '<select class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if (is_array($cate_arbo)) {
|
||||
if (!count($cate_arbo)) {
|
||||
$output .= '<option value="-1" disabled>'.$langs->trans("NoCategoriesDefined").'</option>';
|
||||
@ -4918,7 +4919,11 @@ class Form
|
||||
} else {
|
||||
$add = '';
|
||||
}
|
||||
$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'">'.dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle').'</option>';
|
||||
$output .= '<option '.$add.'value="'.$cate_arbo[$key]['id'].'"';
|
||||
$output .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$cate_arbo[$key]['color'].'"').dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle')).'"';
|
||||
$output .= '>';
|
||||
$output .= dol_trunc($cate_arbo[$key]['fulllabel'], $maxlength, 'middle');
|
||||
$output .= '</option>';
|
||||
|
||||
$outarray[$cate_arbo[$key]['id']] = $cate_arbo[$key]['fulllabel'];
|
||||
}
|
||||
@ -4927,7 +4932,9 @@ class Form
|
||||
$output .= '</select>';
|
||||
$output .= "\n";
|
||||
|
||||
if ($outputmode) {
|
||||
if ($outputmode == 2) {
|
||||
return $cate_arbo;
|
||||
} elseif ($outputmode) {
|
||||
return $outarray;
|
||||
}
|
||||
return $output;
|
||||
@ -5063,7 +5070,7 @@ class Form
|
||||
$more .= $input['label'].'</div><div class="tagtd left">';
|
||||
}
|
||||
if ($input['type'] == 'select') {
|
||||
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
|
||||
$more .= $this->selectarray($input['name'], $input['values'], !empty($input['default']) ? $input['default'] : '-1', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
|
||||
} else {
|
||||
$more .= $this->multiselectarray($input['name'], $input['values'], is_array($input['default']) ? $input['default'] : [$input['default']], $key_in_label, $value_as_key, $morecss, $translate, $maxlen, $moreattr);
|
||||
}
|
||||
@ -8326,8 +8333,8 @@ class Form
|
||||
* Show a multiselect form from an array. WARNING: Use this only for short lists.
|
||||
*
|
||||
* @param string $htmlname Name of select
|
||||
* @param array $array Array with key+value
|
||||
* @param array $selected Array with key+value preselected
|
||||
* @param array $array Array(key=>value) or Array(key=>array('id'=> , 'label'=> ))
|
||||
* @param array $selected Array of keys preselected
|
||||
* @param int $key_in_label 1 to show key like in "[key] value"
|
||||
* @param int $value_as_key 1 to use value as key
|
||||
* @param string $morecss Add more css style
|
||||
@ -8363,14 +8370,24 @@ class Form
|
||||
|
||||
if (!empty($array)) {
|
||||
foreach ($array as $key => $value) {
|
||||
$newval = ($translate ? $langs->trans($value) : $value);
|
||||
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
|
||||
$tmpkey = $key;
|
||||
$tmpvalue = $value;
|
||||
$tmpcolor = '';
|
||||
$tmppicto = '';
|
||||
if (is_array($value) && array_key_exists('id', $value) && array_key_exists('label', $value)) {
|
||||
$tmpkey = $value['id'];
|
||||
$tmpvalue = $value['label'];
|
||||
$tmpcolor = $value['color'];
|
||||
$tmppicto = $value['picto'];
|
||||
}
|
||||
$newval = ($translate ? $langs->trans($tmpvalue) : $tmpvalue);
|
||||
$newval = ($key_in_label ? $tmpkey.' - '.$newval : $newval);
|
||||
|
||||
$out .= '<option value="'.$key.'"';
|
||||
if (is_array($selected) && !empty($selected) && in_array((string) $key, $selected) && ((string) $key != '')) {
|
||||
$out .= '<option value="'.$tmpkey.'"';
|
||||
if (is_array($selected) && !empty($selected) && in_array((string) $tmpkey, $selected) && ((string) $tmpkey != '')) {
|
||||
$out .= ' selected';
|
||||
}
|
||||
$out .= ' data-html="'.dol_escape_htmltag($newval).'"';
|
||||
$out .= ' data-html="'.dol_escape_htmltag(($tmppicto ? img_picto('', $tmppicto, 'class="pictofixedwidth" style="color: #'.$tmpcolor.'"') : '').$newval).'"';
|
||||
$out .= '>';
|
||||
$out .= dol_htmlentitiesbr($newval);
|
||||
$out .= '</option>'."\n";
|
||||
|
||||
@ -32,30 +32,52 @@ class FormCategory extends Form
|
||||
/**
|
||||
* Return a HTML filter box for a list filter view
|
||||
*
|
||||
* @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE)
|
||||
* @param Array $preSelected A list with the elements that should pre-selected
|
||||
* @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list"))
|
||||
* @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE)
|
||||
* @param array $preSelected A list with the elements that should pre-selected
|
||||
* @param string $morecss More CSS
|
||||
* @param int $searchCategoryProductOperator 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected)
|
||||
* @param int $multiselect 0 or 1
|
||||
* @param int $nocateg 1=Add an entry '- No Category -'
|
||||
* @param string $showempty 1 or 'string' to add an empty entry
|
||||
* @return string A HTML filter box (Note: selected results can get with GETPOST("search_category_".$type."_list"))
|
||||
*/
|
||||
public function getFilterBox($type, array $preSelected)
|
||||
public function getFilterBox($type, array $preSelected, $morecss = "minwidth300 widthcentpercentminusx", $searchCategoryProductOperator = -1, $multiselect = 1, $nocateg = 1, $showempty = '')
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $db;
|
||||
|
||||
if (empty($preSelected) || !is_array($preSelected)) {
|
||||
$preSelected = array();
|
||||
}
|
||||
|
||||
$htmlName = "search_category_".$type."_list";
|
||||
|
||||
$categoryArray = $this->select_all_categories($type, "", "", 64, 0, 1);
|
||||
$categoryArray[-2] = "- ".$langs->trans('NotCategorized')." -";
|
||||
|
||||
$tmptitle = $langs->transnoentitiesnoconv("Category");
|
||||
if ($showempty && !is_numeric($showempty)) {
|
||||
$tmptitle = $showempty;
|
||||
} else {
|
||||
$tmptitle = $langs->transnoentitiesnoconv("Category");
|
||||
}
|
||||
|
||||
$filter = '';
|
||||
$filter .= '<div class="divsearchfield">';
|
||||
$filter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||
//$filter .= $langs->trans('Categories').": ";
|
||||
$filter .= Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0, "minwidth300 widthcentpercentminusx", 0, 0, '', '', $tmptitle);
|
||||
if ($multiselect) {
|
||||
$categoryArray = $this->select_all_categories($type, '', '', 64, 0, 2);
|
||||
if ($nocateg) {
|
||||
$categoryArray[-2] = "- ".$langs->trans('NotCategorized')." -";
|
||||
}
|
||||
$htmlName = "search_category_".$type."_list";
|
||||
$htmlName2 = "search_category_".$type."_operator";
|
||||
|
||||
$filter .= Form::multiselectarray($htmlName, $categoryArray, $preSelected, 0, 0, $morecss, 0, 0, '', '', $tmptitle);
|
||||
} else {
|
||||
$htmlName = "search_".$type."_category";
|
||||
$htmlName2 = "";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$filter .= $formother->select_categories($type, $preSelected[0], $htmlName, $nocateg, $tmptitle, $morecss);
|
||||
}
|
||||
if ($searchCategoryProductOperator >= 0) {
|
||||
$filter .= ' <input type="checkbox" class="valignmiddle" id="'.$htmlName2.'" name="'.$htmlName2.'" value="1"'.($searchCategoryProductOperator == 1 ? ' checked="checked"' : '').'/><label class="none valignmiddle" for="'.$htmlName2.'">'.$langs->trans('UseOrOperatorForCategories').'</label>';
|
||||
}
|
||||
$filter .= "</div>";
|
||||
|
||||
return $filter;
|
||||
|
||||
@ -96,6 +96,9 @@ class FormCron extends Form
|
||||
|
||||
$out .= '</SELECT>';
|
||||
}
|
||||
if (empty($readonly)) {
|
||||
$out .= ajax_combobox($htmlname);
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -841,7 +841,7 @@ class FormFile
|
||||
|
||||
$out .= '<td class="minwidth200 tdoverflowmax300">';
|
||||
if ($imgpreview) {
|
||||
$out .= '<span class="spanoverflow widthcentpercentminusx">';
|
||||
$out .= '<span class="spanoverflow widthcentpercentminusx valignmiddle">';
|
||||
} else {
|
||||
$out .= '<span class="spanoverflow">';
|
||||
}
|
||||
|
||||
@ -429,8 +429,7 @@ class FormOther
|
||||
if (!is_numeric($showempty)) {
|
||||
$textforempty = $showempty;
|
||||
}
|
||||
$moreforfilter .= '<option class="optiongrey" value="'.($showempty < 0 ? $showempty : -1).'"'.($selected == $showempty ? ' selected' : '').'>'.$textforempty.'</option>'."\n";
|
||||
//$moreforfilter .= '<option value="0" '.($moreparamonempty ? $moreparamonempty.' ' : '').' class="optiongrey">'.(is_numeric($showempty) ? ' ' : $showempty).'</option>'; // Should use -1 to say nothing
|
||||
$moreforfilter .= '<option class="optiongrey" value="'.($showempty < 0 ? $showempty : -1).'"'.($selected == $showempty ? ' selected' : '').' data-html="'.dol_escape_htmltag($textforempty).'">'.dol_escape_htmltag($textforempty).'</option>'."\n";
|
||||
}
|
||||
|
||||
if (is_array($tab_categs)) {
|
||||
@ -439,6 +438,7 @@ class FormOther
|
||||
if ($categ['id'] == $selected) {
|
||||
$moreforfilter .= ' selected';
|
||||
}
|
||||
$moreforfilter .= ' data-html="'.dol_escape_htmltag(img_picto('', 'category', 'class="pictofixedwidth" style="color: #'.$categ['color'].'"').dol_trunc($categ['fulllabel'], 50, 'middle')).'"';
|
||||
$moreforfilter .= '>'.dol_trunc($categ['fulllabel'], 50, 'middle').'</option>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -689,10 +689,10 @@ class FormProjets
|
||||
$sellist .= '<option value="-1"> </option>';
|
||||
}
|
||||
if ($showallnone) {
|
||||
$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").' --</option>';
|
||||
$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").' --</option>';
|
||||
$sellist .= '<option value="all"'.($preselected == 'all' ? ' selected="selected"' : '').'>-- '.$langs->trans("OnlyOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="openedopp"'.($preselected == 'openedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("OpenedOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="notopenedopp"'.($preselected == 'notopenedopp' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").'</option>';
|
||||
$sellist .= '<option value="none"'.($preselected == 'none' ? ' selected="selected"' : '').'>-- '.$langs->trans("NotAnOpportunityShort").'</option>';
|
||||
}
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
@ -304,7 +304,7 @@ function getDefaultDatesForTransfer()
|
||||
$date_end = dol_get_last_day($year_end, $month_end);
|
||||
}
|
||||
} elseif ($periodbydefaultontransfer == 1) {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now());
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
@ -312,7 +312,7 @@ function getDefaultDatesForTransfer()
|
||||
$pastmonthyear--;
|
||||
}
|
||||
} else {
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
|
||||
@ -267,9 +267,23 @@ function societe_prepare_head(Societe $object)
|
||||
if (!empty($user->rights->partnership->read)) {
|
||||
$langs->load("partnership");
|
||||
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/partnership.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnership");
|
||||
$head[$h][2] = 'partnership';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?socid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnerships");
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
|
||||
$sql .= " WHERE fk_soc = ".((int) $object->id);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbNote = $obj->nb;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'partnerships';
|
||||
if ($nbPartnership > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
|
||||
}
|
||||
|
||||
@ -1159,29 +1159,43 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a clone of instance of object (new instance with same value for properties)
|
||||
* With native = 0: Property that are reference are also new object (full isolation clone). This means $this->db of new object may not be valid.
|
||||
* Create a clone of instance of object (new instance with same value for each properties)
|
||||
* With native = 0: Property that are reference are different memory area in the new object (full isolation clone). This means $this->db of new object may not be valid.
|
||||
* With native = 1: Use PHP clone. Property that are reference are same pointer. This means $this->db of new object is still valid but point to same this->db than original object.
|
||||
* With native = 2: Property that are reference are different memory area in the new object (full isolation clone). Only scalar and array values are cloned. This means $this->db of new object is not valid.
|
||||
*
|
||||
* @param object $object Object to clone
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method+destroy non scalar or array properties (recommended)
|
||||
* @param int $native 0=Full isolation method, 1=Native PHP method, 2=Full isolation method keeping only scalar and array properties (recommended)
|
||||
* @return object Clone object
|
||||
* @see https://php.net/manual/language.oop5.cloning.php
|
||||
*/
|
||||
function dol_clone($object, $native = 0)
|
||||
{
|
||||
if ($native == 0) {
|
||||
// deprecated method, use the method with native = 2 instead
|
||||
$tmpsavdb = null;
|
||||
if (isset($object->db) && isset($object->db->db) && is_object($object->db->db) && get_class($object->db->db) == 'PgSql\Connection') {
|
||||
$tmpsavdb = $object->db;
|
||||
unset($object->db); // Such property can not be serialized with pgsl (when object->db->db = 'PgSql\Connection')
|
||||
}
|
||||
|
||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is hack to be sure to have a new object for all fields
|
||||
$myclone = unserialize(serialize($object)); // serialize then unserialize is a hack to be sure to have a new object for all fields
|
||||
|
||||
if (!empty($tmpsavdb)) {
|
||||
$object->db = $tmpsavdb;
|
||||
}
|
||||
} elseif ($native == 2) {
|
||||
// recommended method to have a full isolated cloned object
|
||||
$myclone = new stdClass();
|
||||
$tmparray = get_object_vars($object); // return only public properties
|
||||
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $propertykey => $propertyval) {
|
||||
if (is_scalar($propertyval) || is_array($propertyval)) {
|
||||
$myclone->$propertykey = $propertyval;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$myclone = clone $object; // PHP clone is a shallow copy only, not a real clone, so properties of references will keep the reference (refering to the same target/variable)
|
||||
}
|
||||
@ -4072,7 +4086,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
|
||||
'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', 'webhook', 'world', 'private',
|
||||
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
))) {
|
||||
$fakey = $pictowithouttext;
|
||||
@ -4121,7 +4135,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'supplier'=>'building', 'technic'=>'cogs',
|
||||
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'url'=>'external-link-alt', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
|
||||
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
|
||||
@ -5637,8 +5651,8 @@ function vatrate($rate, $addpercent = false, $info_bits = 0, $usestarfornpr = 0,
|
||||
* @param integer $form Type of format, HTML or not (not by default)
|
||||
* @param Translate|string $outlangs Object langs for output. '' use default lang. 'none' use international separators.
|
||||
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
|
||||
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
|
||||
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||
* @param int $rounding MINIMUM number of decimal to show. 0=no change, -1=we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT)
|
||||
* @param int|string $forcerounding Force the MAXIMUM of decimal to forcerounding decimal (-1=no change, 'MU' or 'MT' or numeric to round to MU or MT or to a given number of decimal)
|
||||
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
||||
* @return string String with formated amount
|
||||
*
|
||||
@ -5709,8 +5723,14 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
|
||||
}
|
||||
|
||||
// If force rounding
|
||||
if ($forcerounding >= 0) {
|
||||
$nbdecimal = $forcerounding;
|
||||
if ((string) $forcerounding != '-1') {
|
||||
if ($forcerounding == 'MU') {
|
||||
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||
} else if ($forcerounding == 'MT') {
|
||||
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||
} elseif ($forcerounding >= 0) {
|
||||
$nbdecimal = $forcerounding;
|
||||
}
|
||||
}
|
||||
|
||||
// Format number
|
||||
|
||||
@ -66,9 +66,23 @@ function member_prepare_head(Adherent $object)
|
||||
if (getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR') == 'member') {
|
||||
if (!empty($user->rights->partnership->read)) {
|
||||
$nbPartnership = is_array($object->partnerships) ? count($object->partnerships) : 0;
|
||||
$head[$h][0] = DOL_URL_ROOT.'/adherents/partnership.php?rowid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnership");
|
||||
$head[$h][2] = 'partnership';
|
||||
$head[$h][0] = DOL_URL_ROOT.'/partnership/partnership_list.php?rowid='.$object->id;
|
||||
$head[$h][1] = $langs->trans("Partnerships");
|
||||
$nbNote = 0;
|
||||
$sql = "SELECT COUNT(n.rowid) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."partnership as n";
|
||||
$sql .= " WHERE fk_member = ".((int) $object->id);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$nbNote = $obj->nb;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
if ($nbNote > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbNote.'</span>';
|
||||
}
|
||||
$head[$h][2] = 'partnerships';
|
||||
if ($nbPartnership > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbPartnership.'</span>';
|
||||
}
|
||||
|
||||
@ -1611,7 +1611,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
|
||||
// Duration
|
||||
print '<td class="center duration'.($cssonholiday ? ' '.$cssonholiday : '').($cssweekend ? ' '.$cssweekend : '').'">';
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id];
|
||||
$dayWorkLoad = !empty($projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$preselectedday][$lines[$i]->id] : 0;
|
||||
if (!isset($totalforeachday[$preselectedday])) $totalforeachday[$preselectedday] = 0;
|
||||
$totalforeachday[$preselectedday] += $dayWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
@ -1992,7 +1993,7 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
$modeinput = 'hours';
|
||||
for ($idw = 0; $idw < 7; $idw++) {
|
||||
$tmpday = dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||
|
||||
if (!isset($totalforeachday[$tmpday])) $totalforeachday[$tmpday] = 0;
|
||||
$cssonholiday = '';
|
||||
if (!$isavailable[$tmpday]['morning'] && !$isavailable[$tmpday]['afternoon']) {
|
||||
$cssonholiday .= 'onholidayallday ';
|
||||
@ -2003,14 +2004,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
}
|
||||
|
||||
$tmparray = dol_getdate($tmpday);
|
||||
$dayWorkLoad = $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id];
|
||||
$dayWorkLoad = (!empty($projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id]) ? $projectstatic->weekWorkLoadPerTask[$tmpday][$lines[$i]->id] : 0);
|
||||
$totalforeachday[$tmpday] += $dayWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
if ($dayWorkLoad > 0) {
|
||||
$alreadyspent = convertSecondToTime($dayWorkLoad, 'allhourmin');
|
||||
}
|
||||
$alttitle = $langs->trans("AddHereTimeSpentForDay", $tmparray['day'], $tmparray['mon']);
|
||||
$alttitle = $langs->trans("AddHereTimeSpentForDay", !empty($tmparray['day']) ? $tmparray['day'] : 0, $tmparray['mon']);
|
||||
|
||||
global $numstartworkingday, $numendworkingday;
|
||||
$cssweekend = '';
|
||||
@ -2290,7 +2291,8 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
||||
$year = $firstdaytoshowarray['year'];
|
||||
$month = $firstdaytoshowarray['mon'];
|
||||
foreach ($TWeek as $weekIndex => $weekNb) {
|
||||
$weekWorkLoad = $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id];
|
||||
$weekWorkLoad = !empty($projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id]) ? $projectstatic->monthWorkLoadPerTask[$weekNb][$lines[$i]->id] : 0 ;
|
||||
if (!isset($totalforeachweek[$weekNb])) $totalforeachweek[$weekNb] = 0;
|
||||
$totalforeachweek[$weekNb] += $weekWorkLoad;
|
||||
|
||||
$alreadyspent = '';
|
||||
@ -2449,6 +2451,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
|
||||
$arrayidtypeofcontact = array();
|
||||
|
||||
print '<!-- print_projecttasks_array -->';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -2648,12 +2651,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
||||
$plannedworkload = $objp->planned_workload;
|
||||
$total_plannedworkload += $plannedworkload;
|
||||
if (!in_array('plannedworkload', $hiddenfields)) {
|
||||
print '<td class="right">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>';
|
||||
print '<td class="right nowraponall">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>';
|
||||
}
|
||||
if (!in_array('declaredprogress', $hiddenfields)) {
|
||||
$declaredprogressworkload = $objp->declared_progess_workload;
|
||||
$total_declaredprogressworkload += $declaredprogressworkload;
|
||||
print '<td class="right">';
|
||||
print '<td class="right nowraponall">';
|
||||
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
|
||||
print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : '');
|
||||
print '</td>';
|
||||
|
||||
@ -146,7 +146,7 @@ function dolEncrypt($chain, $key = '', $ciphering = "AES-256-CTR")
|
||||
}
|
||||
$ivseed = dolGetRandomBytes($ivlen);
|
||||
|
||||
$newchain = openssl_encrypt($chain, $ciphering, $key, null, $ivseed);
|
||||
$newchain = openssl_encrypt($chain, $ciphering, $key, 0, $ivseed);
|
||||
return 'dolcrypt:'.$ciphering.':'.$ivseed.':'.$newchain;
|
||||
} else {
|
||||
return $chain;
|
||||
@ -180,9 +180,9 @@ function dolDecrypt($chain, $key = '')
|
||||
if (function_exists('openssl_decrypt')) {
|
||||
$tmpexplode = explode(':', $reg[2]);
|
||||
if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) {
|
||||
$newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, null, $tmpexplode[0]);
|
||||
$newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]);
|
||||
} else {
|
||||
$newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, null, null);
|
||||
$newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null);
|
||||
}
|
||||
} else {
|
||||
$newchain = 'Error function openssl_decrypt() not available';
|
||||
|
||||
@ -474,9 +474,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
|
||||
|
||||
-- HRM - Employee
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__);
|
||||
|
||||
-- HRM - Holiday
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
|
||||
|
||||
@ -2254,9 +2254,9 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
|
||||
if (isModEnabled('hrm')) {
|
||||
$langs->load("hrm");
|
||||
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"'));
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("Employees"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"'));
|
||||
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->hasRight('user', 'user', 'write'));
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'read'));
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&contextpage=employeelist", $langs->trans("List"), 1, $user->hasRight('user', 'user', 'read'));
|
||||
|
||||
$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillsManagement"), 0, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'shapes', 'class="paddingright pictofixedwidth"'));
|
||||
|
||||
@ -2412,6 +2412,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=1&filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/list.php?leftmenu=members&statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read'));
|
||||
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read'));
|
||||
|
||||
$newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));
|
||||
|
||||
@ -1881,7 +1881,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj2 = $this->db->fetch_object($resqlseladmin);
|
||||
dol_syslog(get_class($this)."::insert_permissions Add permission id '.$r_id.' to user id=".$obj2->rowid);
|
||||
dol_syslog(get_class($this)."::insert_permissions Add permission id ".$r_id." to user id=".$obj2->rowid);
|
||||
|
||||
$tmpuser = new User($this->db);
|
||||
$result = $tmpuser->fetch($obj2->rowid);
|
||||
@ -1968,13 +1968,14 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
$menu->menu_handler = 'all';
|
||||
|
||||
//$menu->module=strtolower($this->name); TODO When right_class will be same than module name
|
||||
$menu->module = empty($this->rights_class) ?strtolower($this->name) : $this->rights_class;
|
||||
$menu->module = (empty($this->rights_class) ? strtolower($this->name) : $this->rights_class);
|
||||
|
||||
if (!$this->menu[$key]['fk_menu']) {
|
||||
$menu->fk_menu = 0;
|
||||
} else {
|
||||
$foundparent = 0;
|
||||
$fk_parent = $this->menu[$key]['fk_menu'];
|
||||
$reg = array();
|
||||
if (preg_match('/^r=/', $fk_parent)) { // old deprecated method
|
||||
$fk_parent = str_replace('r=', '', $fk_parent);
|
||||
if (isset($this->menu[$fk_parent]['rowid'])) {
|
||||
|
||||
@ -152,37 +152,20 @@ class modApi extends DolibarrModules
|
||||
$this->menu = array(); // List of menus to add
|
||||
$r = 0;
|
||||
|
||||
// Add here entries to declare new menus
|
||||
//
|
||||
// Example to declare a new Top Menu entry and its Left menu entry:
|
||||
// $this->menu[$r]=array( 'fk_menu'=>0, // Put 0 if this is a top menu
|
||||
// 'type'=>'top', // This is a Top menu entry
|
||||
// 'titre'=>'Api top menu',
|
||||
// 'mainmenu'=>'api',
|
||||
// 'leftmenu'=>'api',
|
||||
// 'url'=>'/api/pagetop.php',
|
||||
// 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
//
|
||||
// Example to declare a Left Menu entry into an existing Top menu entry:
|
||||
// $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=xxx', // 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'=>'Api left menu',
|
||||
// 'mainmenu'=>'xxx',
|
||||
// 'leftmenu'=>'api',
|
||||
// 'url'=>'/api/pagelevel2.php',
|
||||
// 'langs'=>'mylangfile@api', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
// 'position'=>100,
|
||||
// 'enabled'=>'$conf->api->enabled', // Define condition to show or hide menu entry. Use '$conf->api->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
// 'perms'=>'1', // Use 'perms'=>'$user->rights->api->level1->level2' if you want your menu with a permission rules
|
||||
// 'target'=>'',
|
||||
// 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
|
||||
// $r++;
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools',
|
||||
'type'=>'left',
|
||||
'titre'=>'ApiExplorer',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
|
||||
'mainmenu'=>'tools',
|
||||
'leftmenu'=>'devtools_api',
|
||||
'url'=>'/api/index.php/explorer',
|
||||
'langs'=>'modulebuilder',
|
||||
'position'=>100,
|
||||
'perms'=>'1',
|
||||
//'enabled'=>'isModEnabled("api") && preg_match(\'/^(devtools)/\',$leftmenu)',
|
||||
'enabled'=>'isModEnabled("api")',
|
||||
'target'=>'_apiexplorer',
|
||||
'user'=>0);
|
||||
|
||||
|
||||
// Exports
|
||||
|
||||
@ -102,16 +102,18 @@ class modModuleBuilder extends DolibarrModules
|
||||
//------------------
|
||||
$this->menu = array();
|
||||
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools',
|
||||
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=tools',
|
||||
'type'=>'left',
|
||||
'titre'=>'ModuleBuilder',
|
||||
'mainmenu'=>'home',
|
||||
'leftmenu'=>'admintools_modulebuilder',
|
||||
'url'=>'/modulebuilder/index.php?mainmenu=home&leftmenu=admintools',
|
||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'),
|
||||
'mainmenu'=>'tools',
|
||||
'leftmenu'=>'devtools_modulebuilder',
|
||||
'url'=>'/modulebuilder/index.php?mainmenu=tools&leftmenu=devtools',
|
||||
'langs'=>'modulebuilder',
|
||||
'position'=>100,
|
||||
'perms'=>'1',
|
||||
'enabled'=>'$conf->modulebuilder->enabled && preg_match(\'/^(admintools|all)/\',$leftmenu) && ($user->admin || $conf->global->MODULEBUILDER_FOREVERYONE)',
|
||||
'perms'=>'$user->hasRight("modulebuilder", "run")',
|
||||
//'enabled'=>'isModEnabled("modulebuilder") && preg_match(\'/^(devtools|all)/\',$leftmenu)',
|
||||
'enabled'=>'isModEnabled("modulebuilder")',
|
||||
'target'=>'_modulebuilder',
|
||||
'user'=>0);
|
||||
}
|
||||
|
||||
@ -372,9 +372,19 @@ if (isset($conf->file->main_authentication) && preg_match('/google/', $conf->fil
|
||||
// Show error message if defined
|
||||
if (!empty($_SESSION['dol_loginmesg'])) {
|
||||
?>
|
||||
<div class="center login_main_message"><div class="error">
|
||||
<?php echo dol_escape_htmltag($_SESSION['dol_loginmesg']); ?>
|
||||
</div></div>
|
||||
<div class="center login_main_message">
|
||||
<?php
|
||||
$message = $_SESSION['dol_loginmesg']; // By default this is an error message
|
||||
if (preg_match('/<!-- warning -->/', $message)) { // if it contains this comment, this is a warning message
|
||||
$message = str_replace('<!-- warning -->', '', $message);
|
||||
print '<div class="warning">';
|
||||
} else {
|
||||
print '<div class="error">';
|
||||
}
|
||||
print dol_escape_htmltag($message);
|
||||
print '</div>';
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
@ -78,6 +78,23 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($massaction == 'preupdateprice' && isModEnabled('category')) {
|
||||
$formquestion = array();
|
||||
|
||||
$valuefield = '<div style="display: flex; align-items: center; justify-content: flex-end; padding-right: 150px">';
|
||||
$valuefield .= '<input type="number" name="pricerate" id="pricerate" min="-100" value="0" style="width: 100px; text-align: right; margin-right: 10px" />%';
|
||||
$valuefield .= '</div>';
|
||||
|
||||
$formquestion[] = array(
|
||||
'type' => 'other',
|
||||
'name' => 'pricerate',
|
||||
'label' => $langs->trans("Rate"),
|
||||
'value' => $valuefield
|
||||
);
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)), "updateprice", $formquestion, 1, 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
if ($massaction == 'presetsupervisor') {
|
||||
$formquestion = array();
|
||||
|
||||
@ -96,6 +113,7 @@ if ($massaction == 'presetsupervisor') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmSetSupervisor"), $langs->trans("ConfirmSetSupervisorQuestion", count($toselect)), "setsupervisor", $formquestion, 1, 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
|
||||
if ($massaction == 'presend') {
|
||||
$langs->load("mails");
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ if ($nolinesbefore) {
|
||||
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
|
||||
<td class="linecolnum center"></td>
|
||||
<?php } ?>
|
||||
<td class="linecoldescription minwidth500imp">
|
||||
<td class="linecoldescription minwidth400imp">
|
||||
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
@ -176,8 +176,7 @@ if ($nolinesbefore) {
|
||||
}
|
||||
$coldisplay++;
|
||||
?>
|
||||
<td class="nobottom linecoldescription minwidth500imp">
|
||||
|
||||
<td class="nobottom linecoldescription minwidth400imp">
|
||||
<?php
|
||||
$freelines = false;
|
||||
if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) {
|
||||
@ -258,9 +257,11 @@ if ($nolinesbefore) {
|
||||
}
|
||||
if (empty($senderissupplier)) {
|
||||
$statustoshow = 1;
|
||||
$statuswarehouse = 'warehouseopen,warehouseinternal';
|
||||
if (!empty($conf->global->ENTREPOT_WAREHOUSEINTERNAL_NOT_SELL)) $statuswarehouse = 'warehouseopen';
|
||||
if (!empty($conf->global->ENTREPOT_EXTRA_STATUS)) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
} else {
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', 1);
|
||||
}
|
||||
@ -234,15 +233,19 @@ if (!empty($morelogincontent)) {
|
||||
|
||||
|
||||
<div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent boxshadow'; ?>" style="max-width: 70%">
|
||||
<?php if ($mode == 'dolibarr' || !$disabled) { ?>
|
||||
<span class="passwordmessagedesc">
|
||||
<?php echo $langs->trans('SendNewPasswordDesc'); ?>
|
||||
</span>
|
||||
<?php } else { ?>
|
||||
<div class="warning center">
|
||||
<?php echo $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ($mode == 'dolibarr' || !$disabled) {
|
||||
if ($action != 'validatenewpassword' && empty($message)) {
|
||||
print '<span class="passwordmessagedesc opacitymedium">';
|
||||
print $langs->trans('SendNewPasswordDesc');
|
||||
print '</span>';
|
||||
}
|
||||
} else {
|
||||
print '<div class="warning center">';
|
||||
print $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode);
|
||||
print '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
367
htdocs/core/tpl/passwordreset.tpl.php
Normal file
367
htdocs/core/tpl/passwordreset.tpl.php
Normal file
@ -0,0 +1,367 @@
|
||||
<?php
|
||||
/* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// To show this page, we need parameters: setnewpassword=1&username=...&passworduidhash=...
|
||||
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', 1);
|
||||
}
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
// DDOS protection
|
||||
$size = (int) $_SERVER['CONTENT_LENGTH'];
|
||||
if ($size > 10000) {
|
||||
$langs->loadLangs(array("errors", "install"));
|
||||
httponly_accessforbidden('<center>'.$langs->trans("ErrorRequestTooLarge").'<br><a href="'.DOL_URL_ROOT.'">'.$langs->trans("ClickHereToGoToApp").'</a></center>', 413, 1);
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
header('Cache-Control: Public, must-revalidate');
|
||||
header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
|
||||
if (GETPOST('dol_hide_topmenu')) {
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
}
|
||||
if (GETPOST('dol_hide_leftmenu')) {
|
||||
$conf->dol_hide_leftmenu = 1;
|
||||
}
|
||||
if (GETPOST('dol_optimize_smallscreen')) {
|
||||
$conf->dol_optimize_smallscreen = 1;
|
||||
}
|
||||
if (GETPOST('dol_no_mouse_hover')) {
|
||||
$conf->dol_no_mouse_hover = 1;
|
||||
}
|
||||
if (GETPOST('dol_use_jmobile')) {
|
||||
$conf->dol_use_jmobile = 1;
|
||||
}
|
||||
|
||||
// If we force to use jmobile, then we reenable javascript
|
||||
if (!empty($conf->dol_use_jmobile)) {
|
||||
$conf->use_javascript_ajax = 1;
|
||||
}
|
||||
|
||||
$php_self = $_SERVER['PHP_SELF'];
|
||||
$php_self .= dol_escape_htmltag($_SERVER["QUERY_STRING"]) ? '?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]) : '';
|
||||
$php_self = str_replace('action=validatenewpassword', '', $php_self);
|
||||
|
||||
$titleofpage = $langs->trans('ResetPassword');
|
||||
|
||||
// Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
|
||||
$arrayofjs = array();
|
||||
|
||||
$disablenofollow = 1;
|
||||
if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) {
|
||||
$disablenofollow = 0;
|
||||
}
|
||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$disablenofollow = 0;
|
||||
}
|
||||
|
||||
print top_htmlhead('', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
|
||||
|
||||
|
||||
$colorbackhmenu1 = '60,70,100'; // topmenu
|
||||
if (!isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) {
|
||||
$conf->global->THEME_ELDY_TOPMENU_BACK1 = $colorbackhmenu1;
|
||||
}
|
||||
$colorbackhmenu1 = empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED) ? (empty($conf->global->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $conf->global->THEME_ELDY_TOPMENU_BACK1) : (empty($user->conf->THEME_ELDY_TOPMENU_BACK1) ? $colorbackhmenu1 : $user->conf->THEME_ELDY_TOPMENU_BACK1);
|
||||
$colorbackhmenu1 = join(',', colorStringToArray($colorbackhmenu1)); // Normalize value to 'x,y,z'
|
||||
|
||||
|
||||
$edituser = new User($db);
|
||||
|
||||
|
||||
// Validate parameters
|
||||
if ($setnewpassword && $username && $passworduidhash) {
|
||||
$result = $edituser->fetch('', $username);
|
||||
if ($result < 0) {
|
||||
$message = '<div class="error">'.dol_escape_htmltag($langs->trans("ErrorTechnicalError")).'</div>';
|
||||
} else {
|
||||
global $dolibarr_main_instance_unique_id;
|
||||
|
||||
//print $edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id.' '.$passworduidhash;
|
||||
if ($edituser->pass_temp && dol_verifyHash($edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id, $passworduidhash)) {
|
||||
// Clear session
|
||||
unset($_SESSION['dol_login']);
|
||||
|
||||
// Parameters to reset the user are validated
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
$message = '<div class="error">'.$langs->trans("ErrorFailedToValidatePasswordReset").'</div>';
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->
|
||||
|
||||
<body class="body bodylogin"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: url(\''.DOL_URL_ROOT.'/viewimage.php?cache=1&noalt=1&modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'\')"'; ?>>
|
||||
|
||||
<?php if (empty($conf->dol_use_jmobile)) { ?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// Set focus on correct field
|
||||
<?php if ($focus_element) {
|
||||
?>$('#<?php echo $focus_element; ?>').focus(); <?php
|
||||
} ?> // Warning to use this only on visible element
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
||||
<div class="login_vertical_align">
|
||||
|
||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="action" value="buildnewpassword">
|
||||
|
||||
|
||||
<!-- Title with version -->
|
||||
<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
|
||||
<?php
|
||||
if (!empty($disablenofollow)) {
|
||||
echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
|
||||
}
|
||||
echo dol_escape_htmltag($title);
|
||||
if (!empty($disablenofollow)) {
|
||||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="login_table">
|
||||
|
||||
<div id="login_line1">
|
||||
|
||||
<div id="login_left">
|
||||
<img alt="" title="" src="<?php echo $urllogo; ?>" id="img_logo" />
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<div id="login_right">
|
||||
|
||||
<div class="tagtable centpercent" title="Login pass" >
|
||||
|
||||
<!-- New pass 1 -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowraponall center valignmiddle tdinputlogin">
|
||||
<!-- <span class="span-icon-user">-->
|
||||
<span class="fa fa-user"></span>
|
||||
<input type="text" maxlength="255" placeholder="<?php echo $langs->trans("NewPassword"); ?>" <?php echo $disabled; ?> id="newpass1" name="newpass1" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($newpass1); ?>" tabindex="1" autofocus />
|
||||
</div>
|
||||
</div>
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd nowraponall center valignmiddle tdinputlogin">
|
||||
<!-- <span class="span-icon-user">-->
|
||||
<span class="fa fa-user"></span>
|
||||
<input type="text" maxlength="255" placeholder="<?php echo $langs->trans("PasswordRetype"); ?>" <?php echo $disabled; ?> id="newpass2" name="newpass2" class="flat input-icon-user minwidth150" value="<?php echo dol_escape_htmltag($newpass2); ?>" tabindex="1" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
$captcha = 0;
|
||||
if (!empty($captcha)) {
|
||||
// Add a variable param to force not using cache (jmobile)
|
||||
$php_self = preg_replace('/[&\?]time=(\d+)/', '', $php_self); // Remove param time
|
||||
if (preg_match('/\?/', $php_self)) {
|
||||
$php_self .= '&time='.dol_print_date(dol_now(), 'dayhourlog');
|
||||
} else {
|
||||
$php_self .= '?time='.dol_print_date(dol_now(), 'dayhourlog');
|
||||
}
|
||||
// TODO: provide accessible captcha variants
|
||||
?>
|
||||
<!-- Captcha -->
|
||||
<div class="trinputlogin">
|
||||
<div class="tagtd tdinputlogin nowrap none valignmiddle">
|
||||
|
||||
<span class="fa fa-unlock"></span>
|
||||
<span class="nofa inline-block">
|
||||
<input id="securitycode" placeholder="<?php echo $langs->trans("SecurityCode"); ?>" class="flat input-icon-security width125" type="text" maxlength="5" name="code" tabindex="3" autocomplete="off" />
|
||||
</span>
|
||||
<span class="nowrap inline-block">
|
||||
<img class="inline-block valignmiddle" src="<?php echo DOL_URL_ROOT ?>/core/antispamimage.php" border="0" width="80" height="32" id="img_securitycode" />
|
||||
<a class="inline-block valignmiddle" href="<?php echo $php_self; ?>" tabindex="4"><?php echo $captcha_refresh; ?></a>
|
||||
</span>
|
||||
|
||||
</div></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
if (!empty($morelogincontent)) {
|
||||
if (is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option) {
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $morelogincontent;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- end div login_right -->
|
||||
|
||||
</div> <!-- end div login_line1 -->
|
||||
|
||||
|
||||
<div id="login_line2" style="clear: both">
|
||||
|
||||
<!-- Button "Regenerate and Send password" -->
|
||||
<br><input type="submit" <?php echo $disabled; ?> class="button small" name="button_password" value="<?php echo $langs->trans('Save'); ?>" tabindex="4" />
|
||||
|
||||
<br>
|
||||
<div class="center" style="margin-top: 15px;">
|
||||
<?php
|
||||
$moreparam = '';
|
||||
if (!empty($conf->dol_hide_topmenu)) {
|
||||
$moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_topmenu='.$conf->dol_hide_topmenu;
|
||||
}
|
||||
if (!empty($conf->dol_hide_leftmenu)) {
|
||||
$moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_hide_leftmenu='.$conf->dol_hide_leftmenu;
|
||||
}
|
||||
if (!empty($conf->dol_no_mouse_hover)) {
|
||||
$moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_no_mouse_hover='.$conf->dol_no_mouse_hover;
|
||||
}
|
||||
if (!empty($conf->dol_use_jmobile)) {
|
||||
$moreparam .= (strpos($moreparam, '?') === false ? '?' : '&').'dol_use_jmobile='.$conf->dol_use_jmobile;
|
||||
}
|
||||
|
||||
print '<a class="alogin" href="'.$dol_url_root.'/index.php'.$moreparam.'">'.$langs->trans('BackToLoginPage').'</a>';
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<div class="center login_main_home divpasswordmessagedesc paddingtopbottom<?php echo empty($conf->global->MAIN_LOGIN_BACKGROUND) ? '' : ' backgroundsemitransparent boxshadow'; ?>" style="max-width: 70%">
|
||||
<?php
|
||||
if ($mode == 'dolibarr' || !$disabled) {
|
||||
if (empty($message)) {
|
||||
print '<span class="passwordmessagedesc opacitymedium">';
|
||||
print $langs->trans('EnterNewPasswordHere');
|
||||
print '</span>';
|
||||
}
|
||||
} else {
|
||||
print '<div class="warning center">';
|
||||
print $langs->trans('AuthenticationDoesNotAllowSendNewPassword', $mode);
|
||||
print '</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<?php if (!empty($message)) { ?>
|
||||
<div class="center login_main_message">
|
||||
<?php echo dol_htmloutput_mesg($message, '', '', 1); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<!-- Common footer is not used for passwordforgotten page, this is same than footer but inside passwordforgotten tpl -->
|
||||
|
||||
<?php
|
||||
if (!empty($conf->global->MAIN_HTML_FOOTER)) {
|
||||
print $conf->global->MAIN_HTML_FOOTER;
|
||||
}
|
||||
|
||||
if (!empty($morelogincontent) && is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option) {
|
||||
if ($format == 'js') {
|
||||
echo "\n".'<!-- Javascript by hook -->';
|
||||
echo $option."\n";
|
||||
}
|
||||
}
|
||||
} elseif (!empty($moreloginextracontent)) {
|
||||
echo '<!-- Javascript by hook -->';
|
||||
echo $moreloginextracontent;
|
||||
}
|
||||
|
||||
// Google Analytics
|
||||
// TODO Add a hook here
|
||||
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AN_ID)) {
|
||||
$tmptagarray = explode(',', $conf->global->MAIN_GOOGLE_AN_ID);
|
||||
foreach ($tmptagarray as $tmptag) {
|
||||
print "\n";
|
||||
print "<!-- JS CODE TO ENABLE for google analtics tag -->\n";
|
||||
print "
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src=\"https://www.googletagmanager.com/gtag/js?id=".trim($tmptag)."\"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '".trim($tmptag)."');
|
||||
</script>";
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// TODO Replace this with a hook
|
||||
// Google Adsense (need Google module)
|
||||
if (!empty($conf->google->enabled) && !empty($conf->global->MAIN_GOOGLE_AD_CLIENT) && !empty($conf->global->MAIN_GOOGLE_AD_SLOT)) {
|
||||
if (empty($conf->dol_use_jmobile)) {
|
||||
?>
|
||||
<div class="center"><br>
|
||||
<script><!--
|
||||
google_ad_client = "<?php echo $conf->global->MAIN_GOOGLE_AD_CLIENT ?>";
|
||||
google_ad_slot = "<?php echo $conf->global->MAIN_GOOGLE_AD_SLOT ?>";
|
||||
google_ad_width = <?php echo $conf->global->MAIN_GOOGLE_AD_WIDTH ?>;
|
||||
google_ad_height = <?php echo $conf->global->MAIN_GOOGLE_AD_HEIGHT ?>;
|
||||
//-->
|
||||
</script>
|
||||
<script src="//pagead2.googlesyndication.com/pagead/show_ads.js"></script>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end of center -->
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!-- END PHP TEMPLATE -->
|
||||
@ -103,7 +103,23 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
|
||||
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).'}';
|
||||
// Build the answer object
|
||||
$resobject = new stdClass();
|
||||
$resobject->triggercode = $action;
|
||||
$resobject->object = dol_clone($object, 2);
|
||||
|
||||
if (property_exists($resobject->object, 'fields')) {
|
||||
unset($resobject->object->fields);
|
||||
}
|
||||
if (property_exists($resobject->object, 'error')) {
|
||||
unset($resobject->object->error);
|
||||
}
|
||||
if (property_exists($resobject->object, 'errors')) {
|
||||
unset($resobject->object->errors);
|
||||
}
|
||||
|
||||
$jsonstr = json_encode($resobject);
|
||||
|
||||
$response = getURLContent($tmpobject->url, 'POST', $jsonstr, 1, array(), array('http', 'https'), 0, -1);
|
||||
if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) {
|
||||
$nbPosts ++;
|
||||
|
||||
@ -493,7 +493,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->datestart)) {
|
||||
print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'datestart', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'datestart', 1, 1, 1, "cronform");
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -505,7 +505,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->dateend)) {
|
||||
print $form->selectDate($object->dateend, 'dateend', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'dateend', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'dateend', 1, 1, 1, "cronform");
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -518,7 +518,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
if (!empty($object->priority)) {
|
||||
$priority = $object->priority;
|
||||
}
|
||||
print "<td><input type=\"text\" size=\"2\" name=\"priority\" value=\"".$priority."\" /> ";
|
||||
print '<td><input type="text" class="width50" name="priority" value="'.$priority.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
@ -530,7 +530,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
$maxrun = $object->maxrun;
|
||||
}
|
||||
print $langs->trans('CronMaxRun')."</td>";
|
||||
print "<td><input type=\"text\" size=\"2\" name=\"maxrun\" value=\"".$maxrun."\" /> ";
|
||||
print '<td><input type="text" class="width50" name="maxrun" value="'.$maxrun.'" /> ';
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print "</td>";
|
||||
@ -538,12 +538,12 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr><td class="fieldrequired">';
|
||||
print $langs->trans('CronDtNextLaunch');
|
||||
print ' ('.$langs->trans('CronFrom').')';
|
||||
//print ' ('.$langs->trans('CronFrom').')';
|
||||
print "</td><td>";
|
||||
if (!empty($object->datenextrun)) {
|
||||
print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform");
|
||||
} else {
|
||||
print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform");
|
||||
print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform", 1, 1);
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
@ -774,7 +774,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr><td>';
|
||||
print $langs->trans('CronLastOutput')."</td><td>";
|
||||
print nl2br($object->lastoutput);
|
||||
print '<span class="small">'.nl2br($object->lastoutput).'</span>';
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
@ -787,7 +787,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
print "\n\n<div class=\"tabsAction\">\n";
|
||||
print "\n\n".'<div class="tabsAction">'."\n";
|
||||
if (!$user->rights->cron->create) {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")).'">'.$langs->trans("Edit").'</a>';
|
||||
} else {
|
||||
|
||||
@ -420,7 +420,7 @@ if (!empty($conf->global->CRON_WARNING_DELAY_HOURS)) {
|
||||
$text .= $langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);
|
||||
}
|
||||
print info_admin($text);
|
||||
print '<br>';
|
||||
//print '<br>';
|
||||
|
||||
//$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = '';
|
||||
@ -447,7 +447,7 @@ print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre center"><input type="text" class="width50" name="search_lastresult" value="'.$search_lastresult.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans("Disabled"), '1'=>$langs->trans("Scheduled")), $search_status, 1);
|
||||
print '</td><td class="liste_titre right">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
@ -460,18 +460,18 @@ print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "t.rowid", "", $param, '',
|
||||
print_liste_field_titre("CronLabel", $_SERVER["PHP_SELF"], "t.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Prority", $_SERVER["PHP_SELF"], "t.priority", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronModule", $_SERVER["PHP_SELF"], "t.module_name", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronType", '', '', "", $param, '', $sortfield, $sortorder, 'tdoverflowmax100 ');
|
||||
print_liste_field_titre("CronFrequency", '', "", "", $param, '', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("CronDtStart", $_SERVER["PHP_SELF"], "t.datestart", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
//print_liste_field_titre("CronDtEnd", $_SERVER["PHP_SELF"], "t.dateend", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronNbRun", $_SERVER["PHP_SELF"], "t.nbrun", "", $param, '', $sortfield, $sortorder, 'right tdoverflowmax50');
|
||||
print_liste_field_titre("CronDtLastLaunch", $_SERVER["PHP_SELF"], "t.datelastrun", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("CronLastResult", $_SERVER["PHP_SELF"], "t.lastresult", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("CronLastOutput", $_SERVER["PHP_SELF"], "t.lastoutput", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
print_liste_field_titre("CronDtNextLaunch", $_SERVER["PHP_SELF"], "t.datenextrun", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "t.status,t.priority", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -560,19 +560,20 @@ if ($num > 0) {
|
||||
print $form->textwithpicto($text, $texttoshow, 1);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$s = '';
|
||||
if ($obj->unitfrequency == "60") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Minutes');
|
||||
}
|
||||
if ($obj->unitfrequency == "3600") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Hours');
|
||||
}
|
||||
if ($obj->unitfrequency == "86400") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Days');
|
||||
}
|
||||
if ($obj->unitfrequency == "604800") {
|
||||
print $langs->trans('CronEach')." ".($obj->frequency)." ".$langs->trans('Weeks');
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Minutes') : $langs->trans('Minute'));
|
||||
} elseif ($obj->unitfrequency == "3600") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Hours') : $langs->trans('Hour'));
|
||||
} elseif ($obj->unitfrequency == "86400") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Days') : $langs->trans('Day'));
|
||||
} elseif ($obj->unitfrequency == "604800") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Weeks') : $langs->trans('Week'));
|
||||
} elseif ($obj->unitfrequency == "2678400") {
|
||||
$s = ($obj->frequency)." ".($obj->frequency > 1 ? $langs->trans('Months') : $langs->trans('Month'));
|
||||
}
|
||||
print '<td class="tdoverflowmax125" title="'.$s.'">';
|
||||
print $s;
|
||||
print '</td>';
|
||||
|
||||
/*
|
||||
|
||||
@ -41,7 +41,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -258,7 +258,7 @@ $helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Ex
|
||||
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0 || $search_user > 0) {
|
||||
if ($sall || $search_user > 0) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number, e.fk_shipping_method,";
|
||||
@ -288,13 +288,10 @@ $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (e.rowid = ef.fk_object)";
|
||||
}
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'expeditiondet as ed ON e.rowid=ed.fk_expedition';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON pd.rowid=ed.fk_origin_line';
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
|
||||
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
|
||||
@ -326,9 +323,7 @@ $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||
}
|
||||
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
@ -408,7 +403,36 @@ if ($search_categ_cus > 0) {
|
||||
if ($search_categ_cus == -2) {
|
||||
$sql .= " AND cc.fk_categorie IS NULL";
|
||||
}
|
||||
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductOperator = -1;
|
||||
$searchCategoryProductList = array($search_product_category);
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."expeditiondet as ed, ".MAIN_DB_PREFIX."commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
} else {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
@ -593,7 +617,7 @@ if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->right
|
||||
$moreforfilter .= img_picto($tmptitle, 'category');
|
||||
//$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
//$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'parent', 1, $tmptitle);
|
||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'search_product_category', 1, $tmptitle);
|
||||
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ if ($user->socid) {
|
||||
}
|
||||
$result = restrictedArea($user, 'expensereport', $id, '');
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -43,7 +43,7 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$nowyear = strftime("%Y", dol_now());
|
||||
$nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt');
|
||||
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
@ -253,7 +253,7 @@ if (empty($dolibarr_main_data_root)) {
|
||||
// Define some constants
|
||||
define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter)
|
||||
define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
|
||||
// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT.
|
||||
// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT when root is not directly the main domain.
|
||||
// Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works.
|
||||
$tmp = '';
|
||||
$found = 0;
|
||||
@ -283,7 +283,8 @@ foreach ($paths as $tmppath) { // We check to find (B+start of C)=A
|
||||
}
|
||||
//print "found=".$found." dolibarr_main_url_root=".$dolibarr_main_url_root."\n";
|
||||
if (!$found) {
|
||||
$tmp = $dolibarr_main_url_root; // If autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
|
||||
// There is no subdir that compose the main url root or autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
|
||||
$tmp = $dolibarr_main_url_root;
|
||||
} else {
|
||||
$tmp = 'http'.(((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : '');
|
||||
}
|
||||
|
||||
@ -848,7 +848,7 @@ if ($object->id > 0) {
|
||||
if ($object->status == 1) {
|
||||
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&socid='.$object->id, '');
|
||||
} else {
|
||||
print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposalGR'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
print dolGetButtonAction($langs->trans('ThirdPartyIsClosed'), $langs->trans('AddSupplierProposal'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -865,7 +865,7 @@ if ($object->id > 0) {
|
||||
if (!empty($orders2invoice) && $orders2invoice > 0) {
|
||||
if ($object->status == 1) {
|
||||
// Company is open
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplierGR'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', '');
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisSupplier'), 'default', DOL_URL_ROOT.'/fourn/commande/list.php?socid='.$object->id.'&search_billed=0&autoselectall=1', '');
|
||||
} else {
|
||||
print dolGetButtonAction('', $langs->trans('CreateInvoiceForThisCustomer'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
|
||||
}
|
||||
|
||||
@ -752,7 +752,7 @@ if ($search_billed > 0) {
|
||||
$help_url = '';
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.email,';
|
||||
@ -782,12 +782,9 @@ $sql .= ", ".MAIN_DB_PREFIX."commande_fournisseur as cf";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (cf.rowid = ef.fk_object)";
|
||||
}
|
||||
if ($sall || $search_product_category > 0) {
|
||||
if ($sall) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commande_fournisseurdet as pd ON cf.rowid=pd.fk_commande';
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON cf.fk_user_author = u.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cf.fk_projet";
|
||||
// We'll need this table joined to the select in order to filter by sale
|
||||
@ -826,9 +823,6 @@ if ($search_request_author) {
|
||||
if ($search_billed != '' && $search_billed >= 0) {
|
||||
$sql .= " AND cf.billed = ".((int) $search_billed);
|
||||
}
|
||||
if ($search_product_category > 0) {
|
||||
$sql .= " AND cp.fk_categorie = ".((int) $search_product_category);
|
||||
}
|
||||
//Required triple check because statut=0 means draft filter
|
||||
if (GETPOST('statut', 'intcomma') !== '') {
|
||||
$sql .= " AND cf.fk_statut IN (".$db->sanitize($db->escape($db->escape(GETPOST('statut', 'intcomma')))).")";
|
||||
@ -920,6 +914,36 @@ if ($search_multicurrency_montant_ttc != '') {
|
||||
if ($search_project_ref != '') {
|
||||
$sql .= natural_search("p.ref", $search_project_ref);
|
||||
}
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductOperator = -1;
|
||||
$searchCategoryProductList = array($search_product_category);
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commande_fournisseurdet as cd WHERE cd.fk_commande = cf.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
} else {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
$sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
|
||||
@ -405,7 +405,7 @@ $formcompany = new FormCompany($db);
|
||||
$thirdparty = new Societe($db);
|
||||
|
||||
$sql = "SELECT";
|
||||
if ($search_all || $search_product_category > 0) {
|
||||
if ($search_all) {
|
||||
$sql = 'SELECT DISTINCT';
|
||||
}
|
||||
$sql .= " f.rowid as facid, f.ref, f.ref_supplier, f.type, f.datef, f.date_lim_reglement as datelimite, f.fk_mode_reglement, f.fk_cond_reglement,";
|
||||
@ -446,7 +446,7 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array
|
||||
if (!$search_all) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
|
||||
}
|
||||
if ($search_all || $search_product_category > 0) {
|
||||
if ($search_all) {
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn';
|
||||
}
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid';
|
||||
@ -594,7 +594,11 @@ if (!empty($searchCategorySupplierList)) {
|
||||
if (intval($searchCategorySupplier) == -2) {
|
||||
$searchCategorySupplierSqlList[] = "NOT EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc)";
|
||||
} elseif (intval($searchCategorySupplier) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
|
||||
if ($searchCategorySupplierOperator == 0) {
|
||||
$searchCategorySupplierSqlList[] = " EXISTS (SELECT ck.fk_soc FROM ".MAIN_DB_PREFIX."categorie_fournisseur as ck WHERE s.rowid = ck.fk_soc AND ck.fk_categorie = ".((int) $searchCategorySupplier).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategorySupplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
@ -612,19 +616,23 @@ if (!empty($searchCategorySupplierList)) {
|
||||
}
|
||||
// Search for tag/category ($searchCategoryProductList is an array of ID)
|
||||
$searchCategoryProductList = $search_product_category ? array($search_product_category) : array();
|
||||
$searchCategorySupplierOperator = 0;
|
||||
$searchCategoryProductOperator = 0;
|
||||
if (!empty($searchCategoryProductList)) {
|
||||
$searchCategoryProductSqlList = array();
|
||||
$listofcategoryid = '';
|
||||
foreach ($searchCategoryProductList as $searchCategoryProduct) {
|
||||
if (intval($searchCategoryProduct) == -2) {
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product)";
|
||||
$searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product)";
|
||||
} elseif (intval($searchCategoryProduct) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
if ($searchCategoryProductOperator == 0) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."facture_fourn_det as fd WHERE fd.fk_facture_fourn = f.rowid AND p.rowid = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
|
||||
}
|
||||
if ($searchCategoryProductOperator == 1) {
|
||||
if (!empty($searchCategoryProductSqlList)) {
|
||||
@ -1476,7 +1484,7 @@ if ($num > 0) {
|
||||
|
||||
// Third party
|
||||
if (!empty($arrayfields['s.nom']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $thirdparty->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1485,7 +1493,7 @@ if ($num > 0) {
|
||||
}
|
||||
// Alias
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
print $thirdparty->name_alias;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1542,8 +1550,9 @@ if ($num > 0) {
|
||||
|
||||
// Payment condition
|
||||
if (!empty($arrayfields['f.fk_cond_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1);
|
||||
$s = $form->form_conditions_reglement($_SERVER['PHP_SELF'], $obj->fk_cond_reglement, 'none', 1, '', -1, -1, 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print dol_escape_htmltag($s);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -1551,8 +1560,9 @@ if ($num > 0) {
|
||||
}
|
||||
// Payment mode
|
||||
if (!empty($arrayfields['f.fk_mode_reglement']['checked'])) {
|
||||
print '<td class="tdoverflowmax100">';
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1);
|
||||
$s = $form->form_modes_reglement($_SERVER['PHP_SELF'], $obj->fk_mode_reglement, 'none', '', -1, 0, '', 1);
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($s).'">';
|
||||
print dol_escape_htmltag($s);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@ -1631,7 +1641,7 @@ if ($num > 0) {
|
||||
|
||||
// Author
|
||||
if (!empty($arrayfields['u.login']['checked'])) {
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print '<td class="tdoverflowmax150">';
|
||||
if ($userstatic->id) {
|
||||
print $userstatic->getLoginUrl(-1);
|
||||
} else {
|
||||
|
||||
@ -211,6 +211,9 @@ ALTER TABLE llx_projet ADD COLUMN location varchar(255);
|
||||
|
||||
ALTER TABLE llx_c_action_trigger MODIFY COLUMN code varchar(128);
|
||||
|
||||
ALTER TABLE llx_overwrite_trans DROP INDEX uk_overwrite_trans;
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey);
|
||||
|
||||
--
|
||||
-- List of all managed triggered events (used for trigger agenda automatic events and for notification)
|
||||
--
|
||||
@ -366,3 +369,8 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
||||
ALTER TABLE llx_prelevement_facture RENAME TO llx_prelevement;
|
||||
ALTER TABLE llx_prelevement_facture_demande RENAME TO llx_prelevement_demande;
|
||||
|
||||
ALTER TABLE llx_prelevement ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn;
|
||||
ALTER TABLE llx_prelevement_demande ADD COLUMN fk_salary INTEGER NULL AFTER fk_facture_fourn;
|
||||
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN birth_place varchar(64);
|
||||
|
||||
@ -17,5 +17,4 @@
|
||||
-- ===========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(lang, transkey);
|
||||
|
||||
ALTER TABLE llx_overwrite_trans ADD UNIQUE INDEX uk_overwrite_trans(entity, lang, transkey);
|
||||
|
||||
@ -20,7 +20,7 @@ create table llx_prelevement
|
||||
(
|
||||
rowid integer AUTO_INCREMENT PRIMARY KEY,
|
||||
fk_facture integer NULL,
|
||||
fk_facture_fourn integer NULL,
|
||||
fk_facture_fourn integer NULL,
|
||||
fk_salary integer NULL,
|
||||
fk_prelevement_lignes integer NOT NULL
|
||||
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -23,6 +23,7 @@ create table llx_prelevement_demande
|
||||
entity integer DEFAULT 1 NOT NULL,
|
||||
fk_facture integer NULL,
|
||||
fk_facture_fourn integer NULL,
|
||||
fk_salary integer NULL,
|
||||
sourcetype varchar(32),
|
||||
amount double(24,8) NOT NULL,
|
||||
date_demande datetime NOT NULL,
|
||||
|
||||
@ -50,6 +50,7 @@ create table llx_user
|
||||
fk_state integer DEFAULT 0,
|
||||
fk_country integer DEFAULT 0,
|
||||
birth date, -- birthday
|
||||
birth_place varchar(64), -- birth place (town)
|
||||
job varchar(128),
|
||||
office_phone varchar(20),
|
||||
office_fax varchar(20),
|
||||
|
||||
@ -222,9 +222,9 @@ if ($action == "set" || empty($action) || preg_match('/upgrade/i', $action)) {
|
||||
print $langs->trans("AdminLoginCreatedSuccessfuly", $login)."<br>";
|
||||
$success = 1;
|
||||
} else {
|
||||
if ($newuser->error == 'ErrorLoginAlreadyExists') {
|
||||
if ($result == -6) { //login or email already exists
|
||||
dolibarr_install_syslog('step5: AdminLoginAlreadyExists', LOG_WARNING);
|
||||
print '<br><div class="warning">'.$langs->trans("AdminLoginAlreadyExists", $login)."</div><br>";
|
||||
print '<br><div class="warning">'.$newuser->error."</div><br>";
|
||||
$success = 1;
|
||||
} else {
|
||||
dolibarr_install_syslog('step5: FailedToCreateAdminLogin '.$newuser->error, LOG_ERR);
|
||||
@ -450,7 +450,7 @@ if ($action == "set") {
|
||||
$morehtml .= '</a></div>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error('', 'step5.php: unknown choice of action');
|
||||
dol_print_error('', 'step5.php: unknown choice of action='.$action.' in create lock file seaction');
|
||||
}
|
||||
|
||||
// Clear cache files
|
||||
|
||||
@ -293,7 +293,11 @@ if (!empty($searchCategoryKnowledgemanagementList)) {
|
||||
if (intval($searchCategoryKnowledgemanagement) == -2) {
|
||||
$searchCategoryKnowledgemanagementSqlList[] = "NOT EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement)";
|
||||
} elseif (intval($searchCategoryKnowledgemanagement) > 0) {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement);
|
||||
if ($searchCategoryKnowledgemanagementOperator == 0) {
|
||||
$searchCategoryKnowledgemanagementSqlList[] = " EXISTS (SELECT ck.fk_knowledgemanagement FROM ".MAIN_DB_PREFIX."categorie_knowledgemanagement as ck WHERE t.rowid = ck.fk_knowledgemanagement AND ck.fk_categorie = ".((int) $searchCategoryKnowledgemanagement).")";
|
||||
} else {
|
||||
$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryKnowledgemanagement);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($listofcategoryid) {
|
||||
|
||||
@ -2333,4 +2333,6 @@ MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Show the price on the generated documents f
|
||||
WarningDisabled=Warning disabled
|
||||
LimitsAndMitigation=Access limits and mitigation
|
||||
DesktopsOnly=Desktops only
|
||||
DesktopsAndSmartphones=Desktops et smartphones
|
||||
DesktopsAndSmartphones=Desktops et smartphones
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download (without login, using a shared link)
|
||||
@ -88,7 +88,7 @@ DeleteFromCat=Remove from tags/category
|
||||
ExtraFieldsCategories=Complementary attributes
|
||||
CategoriesSetup=Tags/categories setup
|
||||
CategorieRecursiv=Link with parent tag/category automatically
|
||||
CategorieRecursivHelp=If option is on, when you add a product into a subcategory, product will also be added into the parent category.
|
||||
CategorieRecursivHelp=If option is on, when you add an object into a subcategory, the object will also be added into the parent categories.
|
||||
AddProductServiceIntoCategory=Add the following product/service
|
||||
AddCustomerIntoCategory=Assign category to customer
|
||||
AddSupplierIntoCategory=Assign category to supplier
|
||||
|
||||
@ -101,8 +101,6 @@ TypeContact_contrat_external_BILLING=Billing customer contact
|
||||
TypeContact_contrat_external_CUSTOMER=Follow-up customer contact
|
||||
TypeContact_contrat_external_SALESREPSIGN=Signing contract customer contact
|
||||
HideClosedServiceByDefault=Hide closed services by default
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download
|
||||
ShowClosedServices=Show Closed Services
|
||||
HideClosedServices=Hide Closed Services
|
||||
UserStartingService=User starting service
|
||||
|
||||
@ -26,7 +26,7 @@ CronCommand=Command
|
||||
CronList=Scheduled jobs
|
||||
CronDelete=Delete scheduled jobs
|
||||
CronConfirmDelete=Are you sure you want to delete these scheduled jobs?
|
||||
CronExecute=Launch scheduled job
|
||||
CronExecute=Launch now
|
||||
CronConfirmExecute=Are you sure you want to execute these scheduled jobs now?
|
||||
CronInfo=Scheduled job module allows to schedule jobs to execute them automatically. Jobs can also be started manually.
|
||||
CronTask=Job
|
||||
@ -58,7 +58,7 @@ CronNote=Comment
|
||||
CronFieldMandatory=Fields %s is mandatory
|
||||
CronErrEndDateStartDt=End date cannot be before start date
|
||||
StatusAtInstall=Status at module installation
|
||||
CronStatusActiveBtn=Schedule
|
||||
CronStatusActiveBtn=Enable scheduling
|
||||
CronStatusInactiveBtn=Disable
|
||||
CronTaskInactive=This job is disabled (not scheduled)
|
||||
CronId=Id
|
||||
|
||||
@ -68,6 +68,4 @@ ConfirmReopenIntervention=Are you sure you want to open back the intervention <b
|
||||
GenerateInter=Generate intervention
|
||||
FichinterNoContractLinked=Intervention %s has been created without a linked contract.
|
||||
ErrorFicheinterCompanyDoesNotExist=Company does not exist. Intervention has not been created.
|
||||
NextDateToIntervention=Date for next intervention generation
|
||||
AllowOnlineSign=Allow online signing
|
||||
AllowExternalDownload=Allow external download
|
||||
NextDateToIntervention=Date for next intervention generation
|
||||
@ -1150,9 +1150,12 @@ SetSupervisor=Set Supervisor
|
||||
CreateExternalUser=Create external user
|
||||
ConfirmAffectTag=Bulk Tag Affect
|
||||
ConfirmSetSupervisor=Bulk Supervisor Set
|
||||
ConfirmUpdatePrice=Choose a increase/decrease price rate
|
||||
ConfirmAffectTagQuestion=Are you sure you want to affect tags to the %s selected record(s)?
|
||||
ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)?
|
||||
ConfirmUpdatePriceQuestion=Are you sure you want to update the price of the %s selected record(s)?
|
||||
CategTypeNotFound=No tag type found for type of records
|
||||
Rate=Rate
|
||||
SupervisorNotFound=Supervisor not found
|
||||
CopiedToClipboard=Copied to clipboard
|
||||
InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
|
||||
|
||||
@ -35,8 +35,8 @@ DateSubscription=Date of membership
|
||||
DateEndSubscription=End date of membership
|
||||
EndSubscription=End of membership
|
||||
SubscriptionId=Contribution ID
|
||||
WithoutSubscription=Without contribution
|
||||
WaitingSubscription=Waiting contribution
|
||||
WithoutSubscription=Without membership
|
||||
WaitingSubscription=Membership pending
|
||||
MemberId=Member Id
|
||||
MemberRef=Member Ref
|
||||
NewMember=New member
|
||||
|
||||
@ -86,7 +86,7 @@ IsAMeasure=Is a measure
|
||||
DirScanned=Directory scanned
|
||||
NoTrigger=No trigger
|
||||
NoWidget=No widget
|
||||
GoToApiExplorer=API explorer
|
||||
ApiExplorer=API explorer
|
||||
ListOfMenusEntries=List of menu entries
|
||||
ListOfDictionariesEntries=List of dictionaries entries
|
||||
ListOfPermissionsDefined=List of defined permissions
|
||||
|
||||
@ -181,6 +181,7 @@ SizeUnitfoot=foot
|
||||
SizeUnitpoint=point
|
||||
BugTracker=Bug tracker
|
||||
SendNewPasswordDesc=This form allows you to request a new password. It will be sent to your email address.<br>Change will become effective once you click on the confirmation link in the email.<br>Check your inbox.
|
||||
EnterNewPasswordHere=Enter your new password here
|
||||
BackToLoginPage=Back to login page
|
||||
AuthenticationDoesNotAllowSendNewPassword=Authentication mode is <b>%s</b>.<br>In this mode, Dolibarr can't know nor change your password.<br>Contact your system administrator if you want to change your password.
|
||||
EnableGDLibraryDesc=Install or enable GD library on your PHP installation to use this option.
|
||||
|
||||
@ -20,6 +20,7 @@ ModulePartnershipName=Partnership management
|
||||
PartnershipDescription=Module Partnership management
|
||||
PartnershipDescriptionLong= Module Partnership management
|
||||
Partnership=Partnership
|
||||
Partnerships=Partnerships
|
||||
AddPartnership=Add partnership
|
||||
CancelPartnershipForExpiredMembers=Partnership: Cancel partnership of members with expired subscriptions
|
||||
PartnershipCheckBacklink=Partnership: Check referring backlink
|
||||
@ -49,8 +50,8 @@ PublicFormRegistrationPartnerDesc=Dolibarr can provide you a public URL/website
|
||||
# Object
|
||||
#
|
||||
DeletePartnership=Delete a partnership
|
||||
PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party
|
||||
PartnershipDedicatedToThisMember=Partnership dedicated to this member
|
||||
PartnershipDedicatedToThisThirdParty=Partnership dedicated to this third party
|
||||
PartnershipDedicatedToThisMember=Partnership dedicated to this member
|
||||
DatePartnershipStart=Start date
|
||||
DatePartnershipEnd=End date
|
||||
ReasonDecline=Decline reason
|
||||
|
||||
@ -416,6 +416,7 @@ ProductsMergeSuccess=Products have been merged
|
||||
ErrorsProductsMerge=Errors in products merge
|
||||
SwitchOnSaleStatus=Switch on sale status
|
||||
SwitchOnPurchaseStatus=Switch on purchase status
|
||||
UpdatePrice=Increase/decrease customer price
|
||||
StockMouvementExtraFields= Extra Fields (stock mouvement)
|
||||
InventoryExtraFields= Extra Fields (inventory)
|
||||
ScanOrTypeOrCopyPasteYourBarCodes=Scan or type or copy/paste your barcodes
|
||||
|
||||
@ -3,3 +3,4 @@ OperationParamDesc=Define the rules to use to extract or set values.<br>Example
|
||||
EmailCollectorLoadThirdPartyHelp=You can use this action to use the email content to find and load an existing thirdparty in your database. The found (or created) thirdparty will be used for following actions that need it.<br>For example, if you want to create a thirdparty with a name extracted from a string 'Name: name to find' present into the body, use the sender email as email, you can set the parameter field like this:<br>'email=HEADER:^From:(.*);name=EXTRACT:BODY:Name:\\s([^\\s]*);client=SET:2;'<br>
|
||||
IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax
|
||||
IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax
|
||||
AllowExternalDownload=Allow external download
|
||||
|
||||
@ -2330,3 +2330,4 @@ HelpCssOnViewDesc=Le CSS utilisé lors de l'affichage du champ.
|
||||
HelpCssOnListDesc=Le CSS utilisé lorsque le champ est à l'intérieur du tableau d'une liste. <br> Exemple : "tdoverflowmax200"
|
||||
RECEPTION_PDF_HIDE_ORDERED=Masquer la quantité commandée sur les documents générés pour les réceptions
|
||||
MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT=Afficher le prix sur les documents générés pour les réceptions
|
||||
AllowExternalDownload=Autoriser le téléchargement externe
|
||||
|
||||
@ -102,7 +102,6 @@ TypeContact_contrat_external_CUSTOMER=Contact client suivi contrat
|
||||
TypeContact_contrat_external_SALESREPSIGN=Contact client signataire contrat
|
||||
HideClosedServiceByDefault=Masquer les services fermés par défaut
|
||||
AllowOnlineSign=Autoriser la signature en ligne
|
||||
AllowExternalDownload=Autoriser le téléchargement externe
|
||||
ShowClosedServices=Afficher les services fermés
|
||||
HideClosedServices=Masquer les services fermés
|
||||
UserStartingService=Utilisateur démarrant le service
|
||||
|
||||
@ -566,7 +566,7 @@ None=Aucun
|
||||
NoneF=Aucune
|
||||
NoneOrSeveral=Aucun ou plusieurs
|
||||
Late=Retard
|
||||
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
|
||||
LateDesc=Le délai qui définit si un enregistrement est en retard ou non dépend de votre configuration. Demandez à votre administrateur pour changer ce délai depuis Accueil - Configuration - Alertes
|
||||
NoItemLate=Aucun élément en retard
|
||||
Photo=Photo
|
||||
Photos=Photos
|
||||
@ -1150,9 +1150,12 @@ SetSupervisor=Choisir un superviseur
|
||||
CreateExternalUser=Créer utilisateur externe
|
||||
ConfirmAffectTag=Affecter les tags en masse
|
||||
ConfirmSetSupervisor=Choisir un superviseur en masse
|
||||
ConfirmUpdatePrice=Choisir un pourcentage de hausse/baisse des prix
|
||||
ConfirmAffectTagQuestion=Êtes-vous sur de vouloir affecter ces catégories aux %s lignes sélectionnées ?
|
||||
ConfirmSetSupervisorQuestion=Êtes-vous sur de vouloir affecter ce superviseur aux %s lignes sélectionnées ?
|
||||
ConfirmUpdatePriceQuestion=Êtes-vous sur de vouloir mettre à jour les prix des %s lignes sélectionnées ?
|
||||
CategTypeNotFound=Aucun type de tag trouvé pour ce type d'enregistrements
|
||||
Rate=Taux
|
||||
SupervisorNotFound=Supervisuer non trouvé
|
||||
CopiedToClipboard=Copié dans le presse-papier
|
||||
InformationOnLinkToContract=Ce montant n’est que le total de toutes les lignes du contrat. Aucune notion de temps n’est prise en considération.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user