mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-12 19:02:35 +01:00
Merge remote-tracking branch 'refs/remotes/Dolibarr/develop' into develop
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -383,8 +383,8 @@ class AccountancyCategory
|
||||
/**
|
||||
* Return list of personalized groups
|
||||
*
|
||||
* @return int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @return array|int Array of personalized groups or < 0 if KO
|
||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @return array Array of groups
|
||||
*/
|
||||
public function getCats($categorytype=-1)
|
||||
{
|
||||
@@ -429,7 +429,7 @@ class AccountancyCategory
|
||||
'position' => $obj->position,
|
||||
'category_type' => $obj->category_type
|
||||
);
|
||||
$i ++;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
@@ -506,9 +506,9 @@ class AccountancyCategory
|
||||
* Get all accounting account of a group.
|
||||
* You must choose between first parameter (personalized group) or the second (free criteria filter)
|
||||
*
|
||||
* @param int $cat_id Id if personalized accounting group/category
|
||||
* @param string $predefinedgroup Sql criteria filter to select accounting accounts
|
||||
* @return array Array of accounting accounts
|
||||
* @param int $cat_id Id if personalized accounting group/category
|
||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||
* @return array Array of accounting accounts
|
||||
*/
|
||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
||||
{
|
||||
|
||||
@@ -72,13 +72,13 @@ print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
@@ -87,15 +87,15 @@ print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
@@ -111,25 +111,25 @@ if (! empty($conf->tax->enabled))
|
||||
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
@@ -150,15 +150,15 @@ $step = 0;
|
||||
$langs->loadLangs(array('bills', 'trips'));
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
|
||||
@@ -249,8 +249,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -390,13 +390,13 @@ if ($rowid > 0)
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
$sql.= " AND d.statut IN (".$status.")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
$sql.= " AND d.statut IN (".$db->escape($status).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
}
|
||||
if ($action == 'search')
|
||||
{
|
||||
if (GETPOST('search'))
|
||||
{
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search'));
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search','alpha'));
|
||||
}
|
||||
}
|
||||
if (! empty($search_lastname))
|
||||
|
||||
@@ -243,6 +243,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
// Page
|
||||
@@ -301,13 +302,13 @@ print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="de
|
||||
print '</td>'."\n";
|
||||
// Field
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidth100" name="defaultkey" value="">';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="">';
|
||||
print '</td>';
|
||||
// Value
|
||||
if ($mode != 'focus')
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidthonsmartphone" name="defaultvalue" value="">';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
|
||||
print '</td>';
|
||||
}
|
||||
// Limit to superadmin
|
||||
@@ -409,6 +410,7 @@ else
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ $actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||
|
||||
$listoffset=GETPOST('listoffset');
|
||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; // To avoid too long dictionaries
|
||||
$active = 1;
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -1155,11 +1155,6 @@ if ($id)
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
/*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
|
||||
{
|
||||
print '* '.$langs->trans("LabelUsedByDefault").'.<br>';
|
||||
}*/
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
@@ -1179,9 +1174,10 @@ if ($id)
|
||||
$i = 0;
|
||||
|
||||
// There is several pages
|
||||
if ($num > $listlimit)
|
||||
if ($num > $listlimit || $page)
|
||||
{
|
||||
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page+1).'</span></li>');
|
||||
print '<div class="clearboth"></div>';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
@@ -1645,6 +1641,8 @@ else
|
||||
*/
|
||||
|
||||
$lastlineisempty=false;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td>'.$langs->trans("Module").'</td>';
|
||||
@@ -1697,6 +1695,7 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -221,9 +221,38 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
|
||||
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
|
||||
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -575,6 +604,40 @@ print '<input type="submit" class="button" value="' . $langs->trans("Modify") .
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Use duration
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("UseDurationOnFichinter");
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"' . ($conf->global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// use date without hour
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("UseDateWithoutHourOnFichinter");
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"' . ($conf->global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/mails_templates.php
|
||||
* \ingroup setup
|
||||
* \brief Page to administer data tables
|
||||
* \ingroup core
|
||||
* \brief Page to administer emails templates
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@@ -52,8 +52,13 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$id=GETPOST('id','int');
|
||||
$rowid=GETPOST('rowid','alpha');
|
||||
$search_label=GETPOST('search_label','alpha');
|
||||
$search_type_template=GETPOST('search_type_template','alpha');
|
||||
$search_topic=GETPOST('search_topic','alpha');
|
||||
$search_lang=GETPOST('search_lang','alpha');
|
||||
$search_fk_user=GETPOST('search_fk_user','intcomma');
|
||||
$search_topic=GETPOST('search_topic','alpha');
|
||||
|
||||
$allowed=$user->admin;
|
||||
$allowed=1;
|
||||
if (! $allowed) accessforbidden();
|
||||
|
||||
$acts[0] = "activate";
|
||||
@@ -86,17 +91,17 @@ $tabsqlsort[25]="label ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
$tabfield[25]= "label,type_template,lang,private,position,topic,content";
|
||||
$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,content";
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines';
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
$tabfieldvalue[25]= "label,type_template,lang,private,position,topic,content";
|
||||
$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,content";
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines';
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
$tabfieldinsert[25]= "label,type_template,lang,private,position,topic,content";
|
||||
$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,content";
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines';
|
||||
$tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays
|
||||
|
||||
@@ -155,6 +160,9 @@ if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$lang
|
||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
||||
if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract');
|
||||
$elementList['all']=$langs->trans('VisibleEverywhere');
|
||||
$elementList['none']=$langs->trans('VisibleNowhere');
|
||||
|
||||
|
||||
$parameters=array('elementList'=>$elementList);
|
||||
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
||||
@@ -184,6 +192,10 @@ if (empty($reshook))
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_label='';
|
||||
$search_type_template='';
|
||||
$search_lang='';
|
||||
$search_fk_user='';
|
||||
$search_topic='';
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
@@ -205,7 +217,7 @@ if (empty($reshook))
|
||||
if ($value == 'content') $value='content-'.$rowid;
|
||||
if ($value == 'content_lines') $value='content_lines-'.$rowid;
|
||||
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='') && $value != 'lang')
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user')
|
||||
{
|
||||
$ok=0;
|
||||
$fieldnamekey=$listfield[$f];
|
||||
@@ -214,7 +226,11 @@ if (empty($reshook))
|
||||
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
|
||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
|
||||
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
|
||||
if ($fieldnamekey == 'type_template') $fieldnamekey = 'TypeOfTemplate';
|
||||
if ($fieldnamekey == 'fk_user') $fieldnamekey = 'Owner';
|
||||
if ($fieldnamekey == 'private') $fieldnamekey = 'Private';
|
||||
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
|
||||
if ($fieldnamekey == 'topic') $fieldnamekey = 'Topic';
|
||||
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||
}
|
||||
@@ -260,6 +276,7 @@ if (empty($reshook))
|
||||
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
|
||||
if ($value == 'entity') $_POST[$keycode] = $conf->entity;
|
||||
if ($i) $sql.=",";
|
||||
if ($value == 'fk_user' && ! ($_POST[$keycode] > 0)) $_POST[$keycode]='';
|
||||
if ($value == 'private' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='0';
|
||||
if ($value == 'position' && ! is_numeric($_POST[$keycode])) $_POST[$keycode]='1';
|
||||
if ($_POST[$keycode] == '' || ($keycode == 'langcode' && empty($_POST[$keycode]))) $sql.="null"; // For vat, we want/accept code = ''
|
||||
@@ -306,7 +323,8 @@ if (empty($reshook))
|
||||
$keycode=$listfieldvalue[$i];
|
||||
if ($field == 'lang') $keycode='langcode';
|
||||
|
||||
if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid];
|
||||
if ($field == 'fk_user' && ! ($_POST['fk_user'] > 0)) $_POST['fk_user']='';
|
||||
if ($field == 'content') $_POST['content']=$_POST['content-'.$rowid];
|
||||
if ($field == 'content_lines') $_POST['content_lines']=$_POST['content_lines-'.$rowid];
|
||||
if ($field == 'entity') $_POST[$keycode] = $conf->entity;
|
||||
if ($i) $sql.=",";
|
||||
@@ -408,17 +426,21 @@ print load_fiche_titre($titre,$linkback,$titlepicto);
|
||||
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetup");
|
||||
$head[$h][2] = 'common';
|
||||
$h++;
|
||||
|
||||
if ($conf->mailing->enabled)
|
||||
if ($user->admin && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu'] != 'email_templates'))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing");
|
||||
$head[$h][2] = 'common_emailing';
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetup");
|
||||
$head[$h][2] = 'common';
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing");
|
||||
$head[$h][2] = 'common_emailing';
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_templates.php";
|
||||
@@ -437,15 +459,23 @@ if ($action == 'delete')
|
||||
//var_dump($elementList);
|
||||
|
||||
|
||||
$sql="SELECT rowid as rowid, label, type_template, lang, private, position, topic, content_lines, content, active";
|
||||
$sql="SELECT rowid as rowid, label, type_template, lang, fk_user, private, position, topic, content_lines, content, active";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."c_email_templates";
|
||||
$sql.=" WHERE entity IN (".getEntity('email_template').")";
|
||||
if ($search_label) $sql.=natural_search('label', $search_label);
|
||||
if (! $user->admin)
|
||||
{
|
||||
$sql.=" AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me
|
||||
$sql.=" AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me
|
||||
}
|
||||
if (empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$sql.= " AND (lang = '".$langs->defaultlang."' OR lang IS NULL)";
|
||||
}
|
||||
|
||||
if ($search_label) $sql.=natural_search('label', $search_label);
|
||||
if ($search_type_template != '' && $search_type_template != '-1') $sql.=natural_search('type_template', $search_type_template);
|
||||
if ($search_lang) $sql.=natural_search('lang', $search_lang);
|
||||
if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_user', $search_fk_user, 2);
|
||||
if ($search_topic) $sql.=natural_search('topic', $search_topic);
|
||||
if ($sortfield)
|
||||
{
|
||||
// If sort order is "country", we use country_code instead
|
||||
@@ -473,25 +503,23 @@ $fieldlist=explode(',',$tabfield[$id]);
|
||||
$alabelisused=0;
|
||||
$var=false;
|
||||
|
||||
$fieldlist=explode(',',$tabfield[$id]);
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
//if ($action != 'edit')
|
||||
//{
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Line for title
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Line to enter new values (title)
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner");}
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
@@ -499,6 +527,8 @@ $fieldlist=explode(',',$tabfield[$id]);
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
@@ -513,98 +543,96 @@ $fieldlist=explode(',',$tabfield[$id]);
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
}
|
||||
}
|
||||
print '<td colspan="3">';
|
||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<td colspan="3">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
// Line to enter new values (input fields)
|
||||
print "<tr " . $bcnd[$var] . ">";
|
||||
|
||||
// Line to enter new values
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd'))
|
||||
{
|
||||
foreach ($fieldlist as $key => $val) {
|
||||
if (GETPOST($val) != '')
|
||||
$obj->$val = GETPOST($val);
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd'))
|
||||
{
|
||||
foreach ($fieldlist as $key=>$val)
|
||||
{
|
||||
if (GETPOST($val) != '')
|
||||
$obj->$val=GETPOST($val);
|
||||
}
|
||||
}
|
||||
$tmpaction = 'create';
|
||||
$parameters = array(
|
||||
'fieldlist' => $fieldlist,
|
||||
'tabname' => $tabname[$id]
|
||||
);
|
||||
$reshook = $hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error = $hookmanager->error;
|
||||
$errors = $hookmanager->errors;
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX . 'c_email_templates' && $action == 'edit') {
|
||||
fieldList($fieldlist, $obj, $tabname[$id], 'hide');
|
||||
} else {
|
||||
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
||||
}
|
||||
}
|
||||
print '<td align="right" colspan="3">';
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<td align="right" colspan="3">';
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
$fieldsforcontent = array('content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) { $fieldsforcontent = array('content','content_lines'); }
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
{
|
||||
print '<tr class="impair nodrag nodrop nohover"><td colspan="6">';
|
||||
if ($tmpfieldlist == 'content')
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong><br>';
|
||||
if ($tmpfieldlist == 'content_lines')
|
||||
print '<strong>' . $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist) . '</strong><br>';
|
||||
|
||||
$fieldsforcontent = array('content');
|
||||
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
|
||||
{
|
||||
$fieldsforcontent = array('content', 'content_lines');
|
||||
}
|
||||
foreach ($fieldsforcontent as $tmpfieldlist)
|
||||
{
|
||||
print '<tr class="impair nodrag nodrop nohover"><td colspan="5">';
|
||||
if ($tmpfieldlist == 'content') print '<strong>'.$form->textwithpicto($langs->trans("Content"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong><br>';
|
||||
if ($tmpfieldlist == 'content_lines') print '<strong>'.$form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'</strong><br>';
|
||||
|
||||
if ($context != 'hide')
|
||||
{
|
||||
//print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
$okforextended=true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended=false;
|
||||
$doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist})?$obj->{$tmpfieldlist}:''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
||||
print $doleditor->Create(1);
|
||||
}
|
||||
else print ' ';
|
||||
print '</td>';
|
||||
if ($tmpfieldlist == 'content')
|
||||
{
|
||||
print '<td align="center" colspan="3" rowspan="'.(count($fieldsforcontent)).'">';
|
||||
if ($action != 'edit')
|
||||
{
|
||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
//else print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($context != 'hide') {
|
||||
// print '<textarea cols="3" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
|
||||
$okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 120, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_4, '90%');
|
||||
print $doleditor->Create(1);
|
||||
} else
|
||||
print ' ';
|
||||
print '</td>';
|
||||
if ($tmpfieldlist == 'content') {
|
||||
print '<td align="center" colspan="3" rowspan="' . (count($fieldsforcontent)) . '">';
|
||||
if ($action != 'edit') {
|
||||
print '<input type="submit" class="button" name="actionadd" value="' . $langs->trans("Add") . '">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// else print '<td></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$colspan=count($fieldlist)+1;
|
||||
//print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||
$colspan=count($fieldlist)+1;
|
||||
//print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
//}
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// List of available record in database
|
||||
@@ -637,12 +665,28 @@ if ($resql)
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($value == 'label') print '<td class="liste_titre"><input type="text" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
elseif ($value == 'lang')
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print $formadmin->select_language($search_lang, 'search_lang', 0, null, 1);
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($value == 'fk_user')
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
$restrictid=array();
|
||||
if (! $user->admin) $restrictid=array($user->id);
|
||||
//var_dump($restrictid);
|
||||
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, 'hierarchyme', null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($value == 'topic') print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
elseif (! in_array($value, array('content', 'content_lines'))) print '<td class="liste_titre"></td>';
|
||||
}
|
||||
if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<td class="liste_titre" align="right" width="64">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
@@ -667,12 +711,15 @@ if ($resql)
|
||||
*/
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner"); }
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
if ($fieldlist[$field]=='private') { $align='center'; }
|
||||
if ($fieldlist[$field]=='position') { $align='center'; }
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
@@ -696,14 +743,13 @@ if ($resql)
|
||||
// Lines with values
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
//print_r($obj);
|
||||
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
$tmpaction='edit';
|
||||
$tmpaction='edit';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
@@ -735,13 +781,14 @@ if ($resql)
|
||||
if ($showfield) {
|
||||
|
||||
print '</tr><tr class="oddeven" nohover tr-'.$tmpfieldlist.'-'.$rowid.' ">';
|
||||
print '<td colspan="5">'; // To create an artificial CR for the current tr we are on
|
||||
print '<td colspan="7">'; // To create an artificial CR for the current tr we are on
|
||||
$okforextended = true;
|
||||
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) $okforextended = false;
|
||||
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
|
||||
print $doleditor->Create(1);
|
||||
print '</td>';
|
||||
print '<td></td><td></td><td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
@@ -770,19 +817,42 @@ if ($resql)
|
||||
{
|
||||
$valuetoshow = $valuetoshow.' - '.$langs->trans("Language_".$valuetoshow);
|
||||
}
|
||||
if ($value == 'fk_user')
|
||||
{
|
||||
if ($valuetoshow > 0)
|
||||
{
|
||||
$fuser=new User($db);
|
||||
$fuser->fetch($valuetoshow);
|
||||
$valuetoshow = $fuser->getNomUrl(1);
|
||||
}
|
||||
}
|
||||
if ($value == 'private')
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
if ($value == 'position')
|
||||
{
|
||||
$align="center";
|
||||
}
|
||||
|
||||
$class='tddict';
|
||||
// Show value for field
|
||||
if ($showfield)
|
||||
{
|
||||
print '<!-- '.$fieldlist[$field].' --><td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
|
||||
print '<!-- '.$fieldlist[$field].' -->';
|
||||
print '<td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
$canbemodified=$iserasable;
|
||||
if (! $user->admin && $obj->fk_user != $user->id)
|
||||
{
|
||||
$iserasable=0;
|
||||
$canbedisabled=0;
|
||||
$canbemodified=0;
|
||||
}
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
|
||||
if ($param) $url .= '&'.$param;
|
||||
@@ -791,28 +861,21 @@ if ($resql)
|
||||
// Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
else
|
||||
{
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
||||
else print $langs->trans("AlwaysActive");
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
if ($canbemodified) print '<td align="center" width="64"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td></td>';
|
||||
|
||||
// Delete link
|
||||
if ($iserasable)
|
||||
{
|
||||
print '<td align="center">';
|
||||
if ($user->admin) print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
print '<td align="center" width="64">';
|
||||
print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||
print '</td>';
|
||||
}
|
||||
else print '<td> </td>';
|
||||
else print '<td></td>';
|
||||
|
||||
/*
|
||||
$fieldsforcontent = array('content');
|
||||
@@ -854,6 +917,7 @@ else {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@@ -875,7 +939,7 @@ $db->close();
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $conf, $langs, $user, $db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
@@ -883,11 +947,43 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'lang')
|
||||
if ($fieldlist[$field] == 'fk_user')
|
||||
{
|
||||
print '<td>';
|
||||
if ($user->admin)
|
||||
{
|
||||
print $form->select_dolusers($obj->{$fieldlist[$field]}, 'fk_user', 1, null, 0, '', null, 0, 0, 1, '', 0, '', 'maxwidth200');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($context == 'add') // I am not admin and we show the add form
|
||||
{
|
||||
print $user->getNomUrl(1); // Me
|
||||
$forcedvalue=$user->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($obj && ! empty($obj->{$fieldlist[$field]}) && $obj->{$fieldlist[$field]} > 0)
|
||||
{
|
||||
$fuser=new User($db);
|
||||
$fuser->fetch($obj->{$fieldlist[$field]});
|
||||
print $fuser->getNomUrl(1);
|
||||
$forcedvalue=$fuser->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forcedvalue=$obj->{$fieldlist[$field]};
|
||||
}
|
||||
}
|
||||
$keyname=$fieldlist[$field];
|
||||
print '<input type="hidden" value="'.$forcedvalue.'" name="'.$keyname.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'lang')
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
@@ -912,21 +1008,38 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
elseif ($fieldlist[$field] == 'type_template')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1);
|
||||
if ($context == 'edit' && ! empty($obj->{$fieldlist[$field]}) && ! in_array($obj->{$fieldlist[$field]}, array_keys($elementList)))
|
||||
{
|
||||
// Current tempalte type is an unknown type, so we must keep it as it is.
|
||||
print '<input type="hidden" name="type_template" value="'.$obj->{$fieldlist[$field]}.'">';
|
||||
print $obj->{$fieldlist[$field]};
|
||||
}
|
||||
else
|
||||
{
|
||||
print $form->selectarray('type_template', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
elseif (in_array($fieldlist[$field], array('content','content_lines'))) continue;
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
$size=''; $class='';
|
||||
$size=''; $class=''; $classtd='';
|
||||
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
||||
if ($fieldlist[$field]=='private') $class='maxwidth50';
|
||||
if ($fieldlist[$field]=='position') $class='maxwidth50';
|
||||
if ($fieldlist[$field]=='private') { $class='maxwidth50'; $classtd='center'; }
|
||||
if ($fieldlist[$field]=='position') { $class='maxwidth50'; $classtd='center'; }
|
||||
if ($fieldlist[$field]=='libelle') $class='quatrevingtpercent';
|
||||
if ($fieldlist[$field]=='topic') $class='quatrevingtpercent';
|
||||
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
|
||||
print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
|
||||
print '<td'.($classtd?' class="'.$classtd.'"':'').'>';
|
||||
if ($fieldlist[$field]=='private' && empty($user->admin))
|
||||
{
|
||||
print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="1" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($cancel) {
|
||||
if ($action == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity);
|
||||
@@ -77,7 +77,7 @@ if ($action == 'update')
|
||||
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity);
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
@@ -134,7 +134,8 @@ if ($action == 'edit') // Edit
|
||||
|
||||
// Misc options
|
||||
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>';
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@@ -142,7 +143,7 @@ if ($action == 'edit') // Edit
|
||||
if (empty($selected)) $selected=dol_getDefaultFormat();
|
||||
|
||||
// Show pdf format
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
|
||||
print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT');
|
||||
print '</td></tr>';
|
||||
@@ -159,26 +160,28 @@ if ($action == 'edit') // Edit
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Addresses
|
||||
print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>';
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide VAT Intra on address
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
|
||||
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Show prof id 1 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
|
||||
@@ -196,7 +199,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 2 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
|
||||
@@ -214,7 +217,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 3 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
|
||||
@@ -232,7 +235,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 4 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
|
||||
@@ -250,6 +253,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -277,7 +281,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
|
||||
$var=true;
|
||||
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print $text;
|
||||
@@ -289,46 +293,48 @@ if ($action == 'edit') // Edit
|
||||
|
||||
// Other
|
||||
print load_fiche_titre($langs->trans("Other"),'','').'<br>';
|
||||
$var=true;
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide any PDF informations
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Desc
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Ref
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Details
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Place customer adress to the ISO location
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
|
||||
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td>';
|
||||
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
@@ -341,17 +347,16 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
else // Show
|
||||
{
|
||||
$var=true;
|
||||
|
||||
// Misc options
|
||||
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','');
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Show pdf format
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
|
||||
|
||||
$pdfformatlabel='';
|
||||
@@ -390,24 +395,26 @@ else // Show
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFAddressForging"),'','');
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide Intra VAT on address
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Show prof id 1 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
|
||||
@@ -425,7 +432,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 2 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
|
||||
@@ -443,7 +450,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 3 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
|
||||
@@ -461,7 +468,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 4 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
|
||||
@@ -479,6 +486,7 @@ else // Show
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -506,11 +514,10 @@ else // Show
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
|
||||
$var=true;
|
||||
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print $text;
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
@@ -518,13 +525,13 @@ else // Show
|
||||
|
||||
// Other
|
||||
print load_fiche_titre($langs->trans("Other"),'','');
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
|
||||
// Encrypt and protect PDF
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$text = $langs->trans("ProtectAndEncryptPdfFiles");
|
||||
@@ -552,48 +559,51 @@ else // Show
|
||||
print '</tr>';
|
||||
|
||||
// Hide any PDF informations
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Desc
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Ref
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Details
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td colspan="2">';
|
||||
print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS];
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Library
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("Library"));
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
@@ -601,10 +611,9 @@ else // Show
|
||||
print '<td>'.$langs->trans("Value").'</td>'."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
if (! empty($dolibarr_pdf_force_fpdf))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>dolibarr_pdf_force_fpdf</td>'."\n";
|
||||
print '<td>';
|
||||
@@ -613,7 +622,7 @@ else // Show
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans("LibraryToBuildPDF").'</td>'."\n";
|
||||
print '<td>';
|
||||
@@ -652,6 +661,7 @@ else // Show
|
||||
print '</tr>'."\n";
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
if (! empty($dolibarr_pdf_force_fpdf))
|
||||
{
|
||||
|
||||
@@ -131,6 +131,7 @@ dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
|
||||
// Upload options
|
||||
$var=false;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
@@ -193,6 +194,7 @@ print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup');
|
||||
print $langs->trans("FileCheckDesc").'<br><br>';
|
||||
|
||||
// Version
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||
@@ -63,6 +64,7 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -133,7 +135,7 @@ if (GETPOST('target') == 'local')
|
||||
if (GETPOST('target') == 'remote')
|
||||
{
|
||||
$xmlarray = getURLContent($xmlremote);
|
||||
|
||||
|
||||
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||
{
|
||||
@@ -147,20 +149,21 @@ if (GETPOST('target') == 'remote')
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($xml)
|
||||
{
|
||||
$checksumconcat = array();
|
||||
$file_list = array();
|
||||
$out = '';
|
||||
|
||||
|
||||
// Forced constants
|
||||
if (is_object($xml->dolibarr_constants[0]))
|
||||
{
|
||||
$out.=load_fiche_titre($langs->trans("ForcedConstants"));
|
||||
|
||||
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -175,13 +178,13 @@ if ($xml)
|
||||
$constname=$constant['name'];
|
||||
$constvalue=(string) $constant;
|
||||
$constvalue = (empty($constvalue)?'0':$constvalue);
|
||||
// Value found
|
||||
// Value found
|
||||
$value='';
|
||||
if ($constname && $conf->global->$constname != '') $value=$conf->global->$constname;
|
||||
$valueforchecksum=(empty($value)?'0':$value);
|
||||
|
||||
|
||||
$checksumconcat[]=$valueforchecksum;
|
||||
|
||||
|
||||
$i++;
|
||||
$out.='<tr class="oddeven">';
|
||||
$out.='<td>'.$i.'</td>' . "\n";
|
||||
@@ -196,10 +199,11 @@ if ($xml)
|
||||
$out.='<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
}
|
||||
|
||||
|
||||
// Scan htdocs
|
||||
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
||||
{
|
||||
@@ -223,10 +227,11 @@ if ($xml)
|
||||
$file_list['added'][]=array('filename'=>$tmprelativefilename, 'md5'=>$md5newfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Files missings
|
||||
$out.=load_fiche_titre($langs->trans("FilesMissing"));
|
||||
|
||||
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -247,18 +252,20 @@ if ($xml)
|
||||
$out.="</tr>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
}
|
||||
$out.='</table>';
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
|
||||
// Files modified
|
||||
$out.=load_fiche_titre($langs->trans("FilesModified"));
|
||||
|
||||
|
||||
$totalsize=0;
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -295,18 +302,20 @@ if ($xml)
|
||||
$out.='<td align="right"></td>' . "\n";
|
||||
$out.="</tr>\n";
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
|
||||
|
||||
// Files added
|
||||
$out.=load_fiche_titre($langs->trans("FilesAdded"));
|
||||
|
||||
|
||||
$totalsize = 0;
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -348,8 +357,9 @@ if ($xml)
|
||||
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
|
||||
// Show warning
|
||||
if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3))
|
||||
{
|
||||
@@ -358,7 +368,7 @@ if ($xml)
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -374,9 +384,9 @@ if ($xml)
|
||||
$file_list = array();
|
||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
|
||||
}*/
|
||||
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
//var_dump($checksumconcat);
|
||||
$checksumget = md5(join(',',$checksumconcat));
|
||||
$checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
|
||||
@@ -397,10 +407,10 @@ if ($xml)
|
||||
{
|
||||
print '<span class="error">'.$checksumget.'</span>';
|
||||
}
|
||||
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Output detail
|
||||
print $out;
|
||||
}
|
||||
@@ -434,7 +444,7 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre
|
||||
{
|
||||
$filename = $path.$file['name'];
|
||||
$file_list['insignature'][] = $filename;
|
||||
|
||||
|
||||
//if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||
|
||||
if (!file_exists($pathref.'/'.$filename))
|
||||
|
||||
@@ -40,26 +40,27 @@ if (!$user->admin) accessforbidden();
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('', $langs->trans("InfoWebServer"));
|
||||
|
||||
print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td>".$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
|
||||
$labeluser=dol_getwebuser('user');
|
||||
$labelgroup=dol_getwebuser('group');
|
||||
if ($labeluser && $labelgroup)
|
||||
{
|
||||
print "<tr $bc[0]><td>".$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@@ -465,13 +465,17 @@ if (! empty($_SESSION["commandbackuplastdone"]))
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end div center button -->
|
||||
|
||||
<?php
|
||||
print '</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end div fichehalfleft -->
|
||||
|
||||
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
|
||||
<div class="ficheaddleft">
|
||||
|
||||
@@ -481,6 +485,7 @@ $result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@ if ($action == 'delete')
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
|
||||
@@ -233,6 +234,7 @@ if ($mode == 'overwrite')
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||
@@ -319,8 +321,8 @@ if ($mode == 'overwrite')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
|
||||
@@ -391,6 +393,7 @@ if ($mode == 'searchkey')
|
||||
print '<input type="hidden" id="action" name="action" value="search">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>';
|
||||
@@ -465,7 +468,7 @@ if ($mode == 'searchkey')
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
|
||||
}
|
||||
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
|
||||
$sqlwhere[]= " (t.fk_pays IN (".implode(',',$arrayquery['contact_country'])."))";
|
||||
$sqlwhere[]= " (t.fk_pays IN (".$db->escape(implode(',',$arrayquery['contact_country']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
|
||||
$sqlwhere[]= " (t.statut IN (".implode(',',$arrayquery['contact_status'])."))";
|
||||
$sqlwhere[]= " (t.statut IN (".$db->escape(implode(',',$arrayquery['contact_status']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
|
||||
$sqlwhere[]= " (t.civility IN ('".implode("','",$arrayquery['contact_civility'])."'))";
|
||||
$sqlwhere[]= " (t.civility IN ('".$db->escape(implode("','",$arrayquery['contact_civility']))."'))";
|
||||
}
|
||||
if ($arrayquery['contact_no_email']!='') {
|
||||
$sqlwhere[]= " (t.no_email='".$arrayquery['contact_no_email']."')";
|
||||
$sqlwhere[]= " (t.no_email='".$db->escape($arrayquery['contact_no_email'])."')";
|
||||
}
|
||||
if ($arrayquery['contact_update_st_dt']!='') {
|
||||
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";
|
||||
@@ -658,7 +658,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]= " (t.datec >= '".$this->db->idate($arrayquery['contact_create_st_dt'])."' AND t.datec <= '".$this->db->idate($arrayquery['contact_create_end_dt'])."')";
|
||||
}
|
||||
if (!empty($arrayquery['contact_categ']) && count($arrayquery['contact_categ'])>0) {
|
||||
$sqlwhere[]= " (contactcateg.fk_categorie IN (".implode(",",$arrayquery['contact_categ'])."))";
|
||||
$sqlwhere[]= " (contactcateg.fk_categorie IN (".$db->escape(implode(",",$arrayquery['contact_categ']))."))";
|
||||
}
|
||||
|
||||
//Standard Extrafield feature
|
||||
|
||||
@@ -320,8 +320,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ dol_mkdir($dir);
|
||||
|
||||
|
||||
$stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode);
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')';
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||
@@ -299,7 +299,7 @@ foreach ($data as $val)
|
||||
while (! empty($year) && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
|
||||
@@ -546,8 +546,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ dol_mkdir($dir);
|
||||
$stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -508,8 +508,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -165,8 +165,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -474,8 +474,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ dol_mkdir($dir);
|
||||
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
|
||||
// Build graphic number of object
|
||||
@@ -299,7 +299,7 @@ foreach ($data as $val)
|
||||
while ($year && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
@@ -310,7 +310,7 @@ foreach ($data as $val)
|
||||
print '<td align="right"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
|
||||
@@ -328,8 +328,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -255,8 +255,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
$maxsizestring=255;
|
||||
$maxsizeint=10;
|
||||
$mesg=array();
|
||||
|
||||
$extrasize=GETPOST('size','int');
|
||||
$type=GETPOST('type','alpha');
|
||||
|
||||
@@ -1399,7 +1399,7 @@ class Form
|
||||
* @param int $enableonly Array list of users id to be enabled. All other must be disabled
|
||||
* @param int $force_entity 0 or Id of environment to force
|
||||
* @return void
|
||||
* @deprecated
|
||||
* @deprecated Use select_dolusers instead
|
||||
* @see select_dolusers()
|
||||
*/
|
||||
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity=0)
|
||||
@@ -1416,7 +1416,7 @@ class Form
|
||||
* @param array $exclude Array list of users id to exclude
|
||||
* @param int $disabled If select list must be disabled
|
||||
* @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
|
||||
* @param array $enableonly Array list of users id to be enabled. All other must be disabled
|
||||
* @param array $enableonly Array list of users id to be enabled. If defined, it means that other must be disabled
|
||||
* @param int $force_entity 0 or Id of environment to force
|
||||
* @param int $maxlength Maximum length of string into list (0=no limit)
|
||||
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
|
||||
@@ -1717,7 +1717,7 @@ class Form
|
||||
unset($producttmpselect);
|
||||
}
|
||||
// mode=1 means customers products
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished.'&warehousestatus='.$warehouseStatus;
|
||||
$urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished.'&hidepriceinlabel='.$hidepriceinlabel.'&warehousestatus='.$warehouseStatus;
|
||||
//Price by customer
|
||||
if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES) && !empty($socid)) {
|
||||
$urloption.='&socid='.$socid;
|
||||
@@ -1919,7 +1919,7 @@ class Form
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||
if (count($warehouseStatusArray))
|
||||
{
|
||||
$sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.implode(',',$warehouseStatusArray).'))';
|
||||
$sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.$db->escape(implode(',',$warehouseStatusArray)).'))';
|
||||
}
|
||||
|
||||
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
|
||||
|
||||
@@ -313,7 +313,7 @@ class FormMail extends Form
|
||||
}
|
||||
|
||||
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
|
||||
if ($result<0)
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
}
|
||||
@@ -321,6 +321,9 @@ class FormMail extends Form
|
||||
foreach($this->lines_model as $line)
|
||||
{
|
||||
$modelmail_array[$line->id]=$line->label;
|
||||
if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')';
|
||||
if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private");
|
||||
//if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' ';
|
||||
}
|
||||
|
||||
// Zone to select its email template
|
||||
@@ -337,11 +340,11 @@ class FormMail extends Form
|
||||
elseif (! empty($this->param['models']) && in_array($this->param['models'], array(
|
||||
'propal_send','order_send','facture_send',
|
||||
'shipping_send','fichinter_send','supplier_proposal_send','order_supplier_send',
|
||||
'invoice_supplier_send','thirdparty'
|
||||
'invoice_supplier_send','thirdparty','all'
|
||||
)))
|
||||
{
|
||||
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||
$out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put disabled on option, it is already on select and it makes chrome crazy.
|
||||
$out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
|
||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
||||
$out.= ' ';
|
||||
$out.= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" disabled="disabled" id="modelselected">';
|
||||
@@ -373,7 +376,7 @@ class FormMail extends Form
|
||||
{
|
||||
$out.= '<input type="hidden" id="fromname" name="fromname" value="'.$this->fromname.'" />';
|
||||
$out.= '<input type="hidden" id="frommail" name="frommail" value="'.$this->frommail.'" />';
|
||||
$out.= '<tr><td width="180">'.$langs->trans("MailFrom").'</td><td>';
|
||||
$out.= '<tr><td width="180" class="fieldrequired">'.$langs->trans("MailFrom").'</td><td>';
|
||||
|
||||
if (! ($this->fromtype === 'user' && $this->fromid > 0)
|
||||
&& ! ($this->fromtype === 'company')
|
||||
@@ -939,7 +942,7 @@ class FormMail extends Form
|
||||
}
|
||||
|
||||
/**
|
||||
* Find if template exists
|
||||
* Find if template exists and are available for current user, then set them into $this->lines_module.
|
||||
* Search into table c_email_templates
|
||||
*
|
||||
* @param string $type_template Get message for key module
|
||||
@@ -952,13 +955,13 @@ class FormMail extends Form
|
||||
{
|
||||
$ret=array();
|
||||
|
||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, position";
|
||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
|
||||
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
|
||||
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
|
||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
|
||||
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
||||
$sql.= $this->db->order("position,lang,label","ASC");
|
||||
//print $sql;
|
||||
|
||||
@@ -972,10 +975,13 @@ class FormMail extends Form
|
||||
$line = new ModelMail();
|
||||
$line->id=$obj->rowid;
|
||||
$line->label=$obj->label;
|
||||
$line->lang=$obj->lang;
|
||||
$line->fk_user=$obj->fk_user;
|
||||
$line->private=$obj->private;
|
||||
$line->position=$obj->position;
|
||||
$line->topic=$obj->topic;
|
||||
$line->content=$obj->content;
|
||||
$line->content_lines=$obj->content_lines;
|
||||
$line->lang=$obj->lang;
|
||||
$this->lines_model[]=$line;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@@ -6207,7 +6207,7 @@ function dol_getmypid()
|
||||
* like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2
|
||||
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
|
||||
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
|
||||
* If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
|
||||
* If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
|
||||
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
|
||||
* @param integer $nofirstand 1=Do not output the first 'AND'
|
||||
* @return string $res The statement to append to the SQL query
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
@@ -21,14 +21,14 @@
|
||||
/**
|
||||
* Returns an array with the tabs for the "Payment" section
|
||||
* It loads tabs from modules looking for the entity payment
|
||||
*
|
||||
*
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_prepare_head(Paiement $object) {
|
||||
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@@ -56,14 +56,14 @@ function payment_prepare_head(Paiement $object) {
|
||||
/**
|
||||
* Returns an array with the tabs for the "Supplier payment" section
|
||||
* It loads tabs from modules looking for the entity payment_supplier
|
||||
*
|
||||
*
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_supplier_prepare_head(Paiement $object) {
|
||||
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@@ -77,7 +77,7 @@ function payment_supplier_prepare_head(Paiement $object) {
|
||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier');
|
||||
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Info');
|
||||
$head[$h][2] = 'info';
|
||||
@@ -95,9 +95,10 @@ function payment_supplier_prepare_head(Paiement $object) {
|
||||
*
|
||||
* @param Societe $fromcompany Third party
|
||||
* @param Translate $langs Output language
|
||||
* @param int $addformmessage Add the payment form message
|
||||
* @return void
|
||||
*/
|
||||
function htmlPrintOnlinePaymentFooter($fromcompany,$langs)
|
||||
function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -149,8 +150,16 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs)
|
||||
$line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
|
||||
}
|
||||
|
||||
print '<br><br><hr>'."\n";
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><font style="font-size: 10px;">'."\n";
|
||||
if ($addformmessage)
|
||||
{
|
||||
$key='ONLINE_PAYMENT_MESSAGE_FORM';
|
||||
if (! empty($conf->global->$key)) print '<br>'.$conf->global->$key;
|
||||
}
|
||||
|
||||
print '<br><hr>'."\n";
|
||||
print $fromcompany->name.'<br>';
|
||||
print $line1.'<br>';
|
||||
print $line2;
|
||||
|
||||
@@ -16,7 +16,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'Accountancy', -1, 'compta', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire', '', 2, 51, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', 14__+MAX_llx_menu__, __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/index.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 60, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('projet', '$conf->projet->enabled', 7__+MAX_llx_menu__, __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 70, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('mailing|export|import|opensurvey|resource', '$conf->mailing->enabled || $conf->export->enabled || $conf->import->enabled || $conf->opensurvey->enabled || $conf->resource->enabled', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '$user->rights->mailing->lire || $user->rights->export->lire || $user->rights->import->run || $user->rights->opensurvey->read || $user->rights->resource->read', '', 2, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 110, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
|
||||
|
||||
@@ -209,7 +209,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2302__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/reglement.php?leftmenu=tax_vat', 'List', 2, 'companies', '$user->rights->tax->charges->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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2303__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/clients.php?leftmenu=tax_vat', 'ReportByCustomers', 2, 'companies', '$user->rights->tax->charges->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->tax->enabled && empty($conf->global->TAX_DISABLE_VAT_MENUS) && $leftmenu=="tax_vat"', __HANDLER__, 'left', 2304__+MAX_llx_menu__, 'billing', '', 2300__+MAX_llx_menu__, '/compta/tva/quadri_detail.php?leftmenu=tax_vat', 'ReportByQuarter', 2, 'companies', '$user->rights->tax->charges->lire', '', 0, 3, __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->banque->enabled', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing', 'MenuVariousPayment', 1, 'various_payment', '$user->rights->banque->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->banque->enabled', __HANDLER__, 'left', 2350__+MAX_llx_menu__, 'billing', 'tax_various', 2200__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing', 'MenuVariousPayment', 1, 'banks', '$user->rights->banque->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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2351__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/card.php?leftmenu=tax_various&action=create', 'MenuNewVariousPayment', 2, 'various_payment', '$user->rights->banque->modifier', '', 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->banque->enabled && $leftmenu=="tax_various"', __HANDLER__, 'left', 2352__+MAX_llx_menu__, 'billing', '', 2350__+MAX_llx_menu__, '/bank/various_payment/index.php?leftmenu=tax_various', 'List', 2, 'various_payment', '$user->rights->banque->lire', '', 0, 3, __ENTITY__);
|
||||
-- Accounting Expert
|
||||
@@ -303,9 +303,10 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
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->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __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->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
|
||||
-- Tools
|
||||
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->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __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->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __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->mailing->enabled', __HANDLER__, 'left', 3902__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->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 ('', '', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'email_templates', 8__+MAX_llx_menu__, '/admin/mails_templates.php?leftmenu=email_templates', 'EMailTemplates', 0, '', '', '', 0, 0, __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->mailing->enabled', __HANDLER__, 'left', 3910__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __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->mailing->enabled', __HANDLER__, 'left', 3911__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __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->mailing->enabled', __HANDLER__, 'left', 3912__+MAX_llx_menu__, 'tools', '', 3910__+MAX_llx_menu__, '/comm/mailing/list.php?leftmenu=mailing', 'List', 1, 'mails', '$user->rights->mailing->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->export->enabled', __HANDLER__, 'left', 4100__+MAX_llx_menu__, 'tools', 'export', 8__+MAX_llx_menu__, '/exports/index.php?leftmenu=export', 'FormatedExport', 0, 'exports', '$user->rights->export->lire', '', 2, 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->export->enabled', __HANDLER__, 'left', 4101__+MAX_llx_menu__, 'tools', '', 4100__+MAX_llx_menu__, '/exports/export.php?leftmenu=export', 'NewExport', 1, 'exports', '$user->rights->export->creer', '', 2, 0, __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->import->enabled', __HANDLER__, 'left', 4130__+MAX_llx_menu__, 'tools', 'import', 8__+MAX_llx_menu__, '/imports/index.php?leftmenu=import', 'FormatedImport', 0, 'exports', '$user->rights->import->run', '', 2, 2, __ENTITY__);
|
||||
|
||||
@@ -241,9 +241,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
|
||||
|
||||
// Tools
|
||||
$tmpentry=array('enabled'=>(! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS) || ! empty($conf->barcode->enabled) || ! empty($conf->mailing->enabled) || ! empty($conf->export->enabled) || ! empty($conf->import->enabled) || ! empty($conf->opensurvey->enabled) || ! empty($conf->resource->enabled)),
|
||||
'perms'=>(! empty($conf->global->MAIN_MENU_ENABLE_MODULETOOLS) || ! empty($conf->barcode->enabled) || ! empty($user->rights->mailing->lire) || ! empty($user->rights->export->lire) || ! empty($user->rights->import->run) || ! empty($user->rights->opensurvey->read) || ! empty($user->rights->resource->read)),
|
||||
'module'=>'mailing|export|import|opensurvey|resource');
|
||||
$tmpentry=array(
|
||||
'enabled'=>1,
|
||||
'perms'=>1,
|
||||
'module'=>'');
|
||||
$showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal);
|
||||
if ($showmode)
|
||||
{
|
||||
@@ -943,6 +944,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
// Various payment
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$langs->load("banks");
|
||||
$newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various');
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/card.php?leftmenu=tax_various&action=create",$langs->trans("MenuNewVariousPayment"), 2, $user->rights->banque->modifier);
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i',$leftmenu)) $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various",$langs->trans("List"),2,$user->rights->banque->lire);
|
||||
@@ -1421,10 +1423,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
*/
|
||||
if ($mainmenu == 'tools')
|
||||
{
|
||||
$langs->load("mails");
|
||||
$newmenu->add("/admin/mails_templates.php?leftmenu=email_templates", $langs->trans("EMailTemplates"), 0, 1, '', $mainmenu, 'email_templates');
|
||||
|
||||
if (! empty($conf->mailing->enabled))
|
||||
{
|
||||
$langs->load("mails");
|
||||
|
||||
$newmenu->add("/comm/mailing/index.php?leftmenu=mailing", $langs->trans("EMailings"), 0, $user->rights->mailing->lire, '', $mainmenu, 'mailing');
|
||||
$newmenu->add("/comm/mailing/card.php?leftmenu=mailing&action=create", $langs->trans("NewMailing"), 1, $user->rights->mailing->creer);
|
||||
$newmenu->add("/comm/mailing/list.php?leftmenu=mailing", $langs->trans("List"), 1, $user->rights->mailing->lire);
|
||||
|
||||
@@ -277,7 +277,15 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$curX = $this->posxdesc-1;
|
||||
|
||||
// Description of product line
|
||||
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
|
||||
if (empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR))
|
||||
{
|
||||
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$txt=$outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'day',false,$outputlangs,true);
|
||||
}
|
||||
|
||||
if ($objectligne->duration > 0)
|
||||
{
|
||||
$txt.=" - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration);
|
||||
|
||||
@@ -211,8 +211,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -92,11 +92,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX."don as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p
|
||||
$sql.= " ON p.rowid = d.fk_projet WHERE 1 = 1";
|
||||
if ($statut != '' && $statut != '-1')
|
||||
{
|
||||
$sql .= " AND d.fk_statut IN (".$statut.")";
|
||||
$sql .= " AND d.fk_statut IN (".$db->escape($statut).")";
|
||||
}
|
||||
if (trim($search_ref) != '')
|
||||
{
|
||||
$sql.= natural_search('d.ref',$search_ref);
|
||||
$sql.= natural_search('d.ref', $search_ref);
|
||||
}
|
||||
if (trim($search_all) != '')
|
||||
{
|
||||
|
||||
@@ -231,8 +231,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -253,8 +253,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ print load_fiche_titre($title, $mesg);
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new ExpenseReportStats($db, $socid, $userid);
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND e.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND e.fk_statut IN ('.$db->escape($object_status).')';
|
||||
|
||||
// Build graphic number of object
|
||||
// $data = array(array('Lib',val1,val2,val3),...)
|
||||
@@ -262,7 +262,7 @@ foreach ($data as $val)
|
||||
while ($year && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
@@ -271,7 +271,7 @@ foreach ($data as $val)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
|
||||
@@ -1379,7 +1379,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print dol_htmlentitiesbr($objp->description);
|
||||
|
||||
// Date
|
||||
print '<td align="center" width="150">'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'</td>';
|
||||
print '<td align="center" width="150">'.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)?dol_print_date($db->jdate($objp->date_intervention),'dayhour'):dol_print_date($db->jdate($objp->date_intervention),'day')).'</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right" width="150">'.(empty($conf->global->FICHINTER_WITHOUT_DURATION)?convertSecondToTime($objp->duree):'').'</td>';
|
||||
@@ -1452,7 +1452,8 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Date d'intervention
|
||||
print '<td align="center" class="nowrap">';
|
||||
$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
|
||||
if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($db->jdate($objp->date_intervention),'di',0,0,0,"date_intervention");
|
||||
else $form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
@@ -1519,7 +1520,8 @@ else if ($id > 0 || ! empty($ref))
|
||||
$timearray=dol_getdate($now);
|
||||
if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
|
||||
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
|
||||
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
|
||||
if (!empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR)) $form->select_date($timewithnohour,'di',0,0,0,"addinter");
|
||||
else $form->select_date($timewithnohour,'di',1,1,0,"addinter");
|
||||
print '</td>';
|
||||
|
||||
// Duration
|
||||
|
||||
@@ -223,8 +223,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ print load_fiche_titre($title,'','title_commercial.png');
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new FichinterStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status > -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||
@@ -291,7 +291,7 @@ foreach ($data as $val)
|
||||
while (! empty($year) && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
|
||||
@@ -304,7 +304,7 @@ foreach ($data as $val)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<tr '.$bc[$var].' height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
|
||||
@@ -535,9 +535,9 @@ if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname
|
||||
if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed;
|
||||
|
||||
//Required triple check because statut=0 means draft filter
|
||||
if (GETPOST('statut', 'alpha') !== '')
|
||||
if (GETPOST('statut', 'intcomma') !== '')
|
||||
{
|
||||
$sql .= " AND cf.fk_statut IN (".$db->escape(GETPOST('statut', 'alpha')).")";
|
||||
$sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")";
|
||||
}
|
||||
if ($search_status != '' && $search_status >= 0)
|
||||
{
|
||||
@@ -589,8 +589,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -373,8 +373,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@ class TCPDI extends FPDF_TPL {
|
||||
* close all files opened by parsers
|
||||
*/
|
||||
function _closeParsers() {
|
||||
if ($this->state > 2 && count($this->parsers) > 0) {
|
||||
if ($this->state > 2 && is_array($this->parsers) && count($this->parsers) > 0) {
|
||||
$this->cleanUp();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -155,6 +155,12 @@ ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer;
|
||||
ALTER TABLE llx_projet_task_time ADD COLUMN datec date;
|
||||
ALTER TABLE llx_projet_task_time ADD COLUMN tms timestamp;
|
||||
|
||||
ALTER TABLE llx_product_price ADD COLUMN fk_multicurrency integer;
|
||||
ALTER TABLE llx_product_price ADD COLUMN multicurrency_code varchar(255);
|
||||
ALTER TABLE llx_product_price ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
|
||||
ALTER TABLE llx_product_price ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
|
||||
ALTER TABLE llx_product_price ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_creat integer;
|
||||
ALTER TABLE llx_product_price_by_qty ADD COLUMN fk_user_modif integer;
|
||||
ALTER TABLE llx_product_price_by_qty DROP COLUMN date_price;
|
||||
@@ -534,6 +540,9 @@ ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pa
|
||||
|
||||
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);
|
||||
|
||||
ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer;
|
||||
ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
|
||||
|
||||
|
||||
UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories';
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ ALTER TABLE llx_product_price ADD COLUMN multicurrency_price_ttc double(24,8) DE
|
||||
ALTER TABLE llx_website_page ADD COLUMN fk_user_create integer;
|
||||
ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
|
||||
|
||||
|
||||
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
||||
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);
|
||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1);
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
|
||||
UPDATE llx_user set api_key = null where api_key = '';
|
||||
|
||||
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
||||
|
||||
-- delete foreign key that should never exists
|
||||
ALTER TABLE llx_propal DROP FOREIGN KEY fk_propal_fk_currency;
|
||||
|
||||
@@ -25,7 +25,7 @@ create table llx_c_email_templates
|
||||
type_template varchar(32), -- template for which type of email (send invoice by email, send order, ...)
|
||||
lang varchar(6),
|
||||
private smallint DEFAULT 0 NOT NULL, -- Template public or private
|
||||
fk_user integer, -- Id utilisateur si modele prive, sinon null
|
||||
fk_user integer, -- Id user owner if template is private, or null
|
||||
datec datetime,
|
||||
tms timestamp,
|
||||
label varchar(255), -- Label of predefined email
|
||||
|
||||
@@ -409,7 +409,7 @@ ComputedFormulaDesc=You can enter here a formula using other properties of objec
|
||||
ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>code3,value3<br>...<br><br>In order to have the list depending on another complementary attribute list :<br>1,value1|options_<i>parent_list_code</i>:parent_key<br>2,value2|options_<i>parent_list_code</i>:parent_key <br><br>In order to have the list depending on another list :<br>1,value1|<i>parent_list_code</i>:parent_key<br>2,value2|<i>parent_list_code</i>:parent_key
|
||||
ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')<br><br> for example : <br>1,value1<br>2,value2<br>3,value3<br>...
|
||||
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||
ExtrafieldParamHelpsellist=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>- idfilter is necessarly a primary int key<br>- filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list:<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||
ExtrafieldParamHelpchkbxlst=List of values comes from a table<br>Syntax : table_name:label_field:id_field::filter<br>Example : c_typent:libelle:id::filter<br><br>filter can be a simple test (eg active=1) to display only active value<br>You can also use $ID$ in filter witch is the current id of current object<br>To do a SELECT in filter use $SEL$<br>if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)<br><br>In order to have the list depending on another complementary attribute list :<br>c_typent:libelle:id:options_<i>parent_list_code</i>|parent_column:filter <br><br>In order to have the list depending on another list:<br>c_typent:libelle:id:<i>parent_list_code</i>|parent_column:filter
|
||||
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath<br>Syntax : ObjectName:Classpath<br>Example : Societe:societe/class/societe.class.php
|
||||
LibraryToBuildPDF=Library used for PDF generation
|
||||
@@ -1674,6 +1674,8 @@ OpportunityPercent=When you create an opportunity, you will defined an estimated
|
||||
TemplateForElement=This template record is dedicated to which element
|
||||
TypeOfTemplate=Type of template
|
||||
TemplateIsVisibleByOwnerOnly=Template is visible by owner only
|
||||
VisibleEverywhere=Visible everywhere
|
||||
VisibleNowhere=Visible nowhere
|
||||
FixTZ=TimeZone fix
|
||||
FillFixTZOnlyIfRequired=Example: +2 (fill only if problem experienced)
|
||||
ExpectedChecksum=Expected Checksum
|
||||
|
||||
@@ -48,6 +48,8 @@ TypeContact_fichinter_external_CUSTOMER=Following-up customer contact
|
||||
PrintProductsOnFichinter=Print also lines of type "product" (not only services) on intervention card
|
||||
PrintProductsOnFichinterDetails=interventions generated from orders
|
||||
UseServicesDurationOnFichinter=Use services duration for interventions generated from orders
|
||||
UseDurationOnFichinter=Hides the duration field for intervention records
|
||||
UseDateWithoutHourOnFichinter=Hides hours and minutes off the date field for intervention records
|
||||
InterventionStatistics=Statistics of interventions
|
||||
NbOfinterventions=Nb of intervention cards
|
||||
NumberOfInterventionsByMonth=Nb of intervention cards by month (date of validation)
|
||||
|
||||
@@ -24,7 +24,7 @@ FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
|
||||
FormatDateHourTextShort=%b %d, %Y, %I:%M %p
|
||||
FormatDateHourText=%B %d, %Y, %I:%M %p
|
||||
DatabaseConnection=Database connection
|
||||
NoTemplateDefined=No template defined for this email type
|
||||
NoTemplateDefined=No template available for this email type
|
||||
AvailableVariables=Available substitution variables
|
||||
NoTranslation=No translation
|
||||
NoRecordFound=No record found
|
||||
@@ -805,6 +805,7 @@ ConfirmSetToDraft=Are you sure you want to go back to Draft status ?
|
||||
ImportId=Import id
|
||||
Websites=Web sites
|
||||
Events=Events
|
||||
EMailTemplates=Emails templates
|
||||
# Week day
|
||||
Monday=Monday
|
||||
Tuesday=Tuesday
|
||||
@@ -834,7 +835,7 @@ ShortThursday=T
|
||||
ShortFriday=F
|
||||
ShortSaturday=S
|
||||
ShortSunday=S
|
||||
SelectMailModel=Select email template
|
||||
SelectMailModel=Select an email template
|
||||
SetRef=Set ref
|
||||
Select2ResultFoundUseArrows=Some results found. Use arrows to select.
|
||||
Select2NotFound=No result found
|
||||
|
||||
@@ -19,6 +19,9 @@ TextNextMonthOfInvoice=Following month (text) of invoice date
|
||||
ZipFileGeneratedInto=Zip file generated into <b>%s</b>.
|
||||
DocFileGeneratedInto=Doc file generated into <b>%s</b>.
|
||||
JumpToLogin=Disconnected. Go to login page...
|
||||
MessageForm=Message on online payment form
|
||||
MessageOK=Message on validated payment return page
|
||||
MessageKO=Message on canceled payment return page
|
||||
|
||||
YearOfInvoice=Year of invoice date
|
||||
PreviousYearOfInvoice=Previous year of invoice date
|
||||
|
||||
@@ -30,8 +30,6 @@ InformationToFindParameters=Help to find your %s account information
|
||||
PAYBOX_CGI_URL_V2=Url of Paybox CGI module for payment
|
||||
VendorName=Name of vendor
|
||||
CSSUrlForPaymentForm=CSS style sheet url for payment form
|
||||
MessageOK=Message on validated payment return page
|
||||
MessageKO=Message on canceled payment return page
|
||||
NewPayboxPaymentReceived=New Paybox payment received
|
||||
NewPayboxPaymentFailed=New Paybox payment tried but failed
|
||||
PAYBOX_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or failed)
|
||||
|
||||
@@ -31,8 +31,6 @@ InformationToFindParameters=Help to find your %s account information
|
||||
STRIPE_CGI_URL_V2=Url of Stripe CGI module for payment
|
||||
VendorName=Name of vendor
|
||||
CSSUrlForPaymentForm=CSS style sheet url for payment form
|
||||
MessageOK=Message on validated payment return page
|
||||
MessageKO=Message on canceled payment return page
|
||||
NewStripePaymentReceived=New Stripe payment received
|
||||
NewStripePaymentFailed=New Stripe payment tried but failed
|
||||
STRIPE_TEST_SECRET_KEY=Secret test key
|
||||
|
||||
@@ -48,6 +48,8 @@ TypeContact_fichinter_external_CUSTOMER=Contact client suivi de l'intervention
|
||||
PrintProductsOnFichinter=Imprimer aussi les lignes de type "produit" (pas seulement de type service) sur les fiches d'intervention
|
||||
PrintProductsOnFichinterDetails=interventions générées à partir des commandes
|
||||
UseServicesDurationOnFichinter=Utiliser la durée des services dans les interventions créées depuis des commandes
|
||||
UseDurationOnFichinter=Masquer le champ durée dans les fiches d'intervention
|
||||
UseDateWithoutHourOnFichinter=Masquer l'heure de la date d'intervention
|
||||
InterventionStatistics=Statistiques des interventions
|
||||
NbOfinterventions=Nb de fiches d'intervention
|
||||
NumberOfInterventionsByMonth=Nb de fiches d'intervention par mois (date de validation)
|
||||
|
||||
@@ -227,8 +227,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0'))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@@ -355,7 +356,7 @@ $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
$selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
|
||||
@@ -57,9 +57,11 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_OK','alpha'),'chaine',0,'',$conf->entity);
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_KO",GETPOST('ONLINE_PAYMENT_KO','alpha'),'chaine',0,'',$conf->entity);
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
@@ -182,6 +184,12 @@ print '<br>'.$langs->trans("Example").': http://mysite/mycss.css';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageForm").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageOK").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
|
||||
|
||||
@@ -64,6 +64,8 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",GETPOST('PAYPAL_ADD_PAYMENT_URL','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO'),'chaine',0,'',$conf->entity);
|
||||
@@ -220,6 +222,13 @@ print $form->selectyesno("PAYPAL_ADD_PAYMENT_URL",$conf->global->PAYPAL_ADD_PAYM
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageForm").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_4,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageOK").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_4,'90%');
|
||||
|
||||
@@ -51,6 +51,7 @@ $price_by_qty_rowid = GETPOST('pbq', 'int');
|
||||
$finished = GETPOST('finished', 'int');
|
||||
$alsoproductwithnosupplierprice = GETPOST('alsoproductwithnosupplierprice', 'int');
|
||||
$warehouseStatus = GETPOST('warehousestatus', 'alpha');
|
||||
$hidepriceinlabel = GETPOST('hidepriceinlabel', 'int');
|
||||
|
||||
|
||||
/*
|
||||
@@ -192,7 +193,7 @@ else
|
||||
|
||||
$form = new Form($db);
|
||||
if (empty($mode) || $mode == 1) { // mode=1: customer
|
||||
$arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid, '1', 0, '', 0, $warehouseStatus);
|
||||
$arrayresult = $form->select_produits_list("", $htmlname, $type, 0, $price_level, $searchkey, $status, $finished, $outjson, $socid, '1', 0, '', $hidepriceinlabel, $warehouseStatus);
|
||||
} elseif ($mode == 2) { // mode=2: supplier
|
||||
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, 0, $alsoproductwithnosupplierprice);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class FormProduct
|
||||
* @param string $batch Add quantity of batch stock in label for product with batch name batch, batch name precedes batch_id. Nothing if ''.
|
||||
* @param string $status warehouse status filter, following comma separated filter options can be used
|
||||
* 'warehouseopen' = select products from open warehouses,
|
||||
* 'warehouseclosed' = select products from closed warehouses,
|
||||
* 'warehouseclosed' = select products from closed warehouses,
|
||||
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
||||
* @param boolean $sumStock sum total stock of a warehouse, default true
|
||||
* @param array $exclude warehouses ids to exclude
|
||||
@@ -68,28 +68,28 @@ class FormProduct
|
||||
global $conf, $langs;
|
||||
|
||||
if (empty($fk_product) && count($this->cache_warehouses)) return 0; // Cache already loaded and we do not want a list with information specific to a product
|
||||
|
||||
|
||||
if (is_array($exclude)) $excludeGroups = implode("','",$exclude);
|
||||
|
||||
$warehouseStatus = array();
|
||||
|
||||
if (preg_match('/warehouseclosed/', $status))
|
||||
if (preg_match('/warehouseclosed/', $status))
|
||||
{
|
||||
$warehouseStatus[] = Entrepot::STATUS_CLOSED;
|
||||
}
|
||||
if (preg_match('/warehouseopen/', $status))
|
||||
if (preg_match('/warehouseopen/', $status))
|
||||
{
|
||||
$warehouseStatus[] = Entrepot::STATUS_OPEN_ALL;
|
||||
}
|
||||
if (preg_match('/warehouseinternal/', $status))
|
||||
if (preg_match('/warehouseinternal/', $status))
|
||||
{
|
||||
$warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL;
|
||||
}
|
||||
|
||||
|
||||
$sql = "SELECT e.rowid, e.label, e.description, e.fk_parent";
|
||||
if (!empty($fk_product))
|
||||
if (!empty($fk_product))
|
||||
{
|
||||
if (!empty($batch))
|
||||
if (!empty($batch))
|
||||
{
|
||||
$sql.= ", pb.qty as stock";
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class FormProduct
|
||||
if (!empty($fk_product))
|
||||
{
|
||||
$sql.= " AND ps.fk_product = '".$fk_product."'";
|
||||
if (!empty($batch))
|
||||
if (!empty($batch))
|
||||
{
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb on pb.fk_product_stock = ps.rowid AND pb.batch = '".$batch."'";
|
||||
}
|
||||
@@ -115,15 +115,15 @@ class FormProduct
|
||||
$sql.= " WHERE e.entity IN (".getEntity('stock').")";
|
||||
if (count($warehouseStatus))
|
||||
{
|
||||
$sql.= " AND e.statut IN (".implode(',',$warehouseStatus).")";
|
||||
$sql.= " AND e.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " AND e.statut = 1";
|
||||
}
|
||||
|
||||
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.implode(',', $exclude).')';
|
||||
|
||||
|
||||
if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$db->escape(implode(',', $exclude)).')';
|
||||
|
||||
if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent";
|
||||
$sql.= " ORDER BY e.label";
|
||||
|
||||
@@ -144,7 +144,7 @@ class FormProduct
|
||||
$this->cache_warehouses[$obj->rowid]['stock'] = $obj->stock;
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
// Full label init
|
||||
foreach($this->cache_warehouses as $obj_rowid=>$tab) {
|
||||
$this->cache_warehouses[$obj_rowid]['full_label'] = $this->get_parent_path($tab);
|
||||
@@ -158,18 +158,18 @@ class FormProduct
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return full path to current warehouse in $tab (recursive function)
|
||||
*
|
||||
*
|
||||
* @param array $tab warehouse data in $this->cache_warehouses line
|
||||
* @param String $final_label full label with all parents, separated by ' >> ' (completed on each call)
|
||||
* @return String full label with all parents, separated by ' >> '
|
||||
*/
|
||||
private function get_parent_path($tab, $final_label='') {
|
||||
|
||||
|
||||
if(empty($final_label)) $final_label = $tab['label'];
|
||||
|
||||
|
||||
if(empty($tab['parent_id'])) return $final_label;
|
||||
else {
|
||||
if(!empty($this->cache_warehouses[$tab['parent_id']])) {
|
||||
@@ -177,9 +177,9 @@ class FormProduct
|
||||
return $this->get_parent_path($this->cache_warehouses[$tab['parent_id']], $final_label);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $final_label;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,7 +189,7 @@ class FormProduct
|
||||
* @param string $htmlname Name of html select html
|
||||
* @param string $filterstatus warehouse status filter, following comma separated filter options can be used
|
||||
* 'warehouseopen' = select products from open warehouses,
|
||||
* 'warehouseclosed' = select products from closed warehouses,
|
||||
* 'warehouseclosed' = select products from closed warehouses,
|
||||
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
|
||||
* @param int $empty 1=Can be empty, 0 if not
|
||||
* @param int $disabled 1=Select is disabled
|
||||
@@ -208,7 +208,7 @@ class FormProduct
|
||||
global $conf,$langs,$user;
|
||||
|
||||
dol_syslog(get_class($this)."::selectWarehouses $selected, $htmlname, $filterstatus, $empty, $disabled, $fk_product, $empty_label, $showstock, $forcecombo, $morecss",LOG_DEBUG);
|
||||
|
||||
|
||||
$out='';
|
||||
if (empty($conf->global->ENTREPOT_EXTRA_STATUS)) $filterstatus = '';
|
||||
$this->loadWarehouses($fk_product, '', $filterstatus, true, $exclude);
|
||||
@@ -221,7 +221,7 @@ class FormProduct
|
||||
$out.= $comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
}
|
||||
|
||||
|
||||
$out.='<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled':'').' id="'.$htmlname.'" name="'.($htmlname.($disabled?'_disabled':'')).'"'.$nodatarole.'>';
|
||||
if ($empty) $out.='<option value="-1">'.($empty_label?$empty_label:' ').'</option>';
|
||||
foreach($this->cache_warehouses as $id => $arraytypes)
|
||||
|
||||
@@ -3750,7 +3750,7 @@ class Product extends CommonObject
|
||||
$sql.= " WHERE w.entity IN (".getEntity('stock').")";
|
||||
$sql.= " AND w.rowid = ps.fk_entrepot";
|
||||
$sql.= " AND ps.fk_product = ".$this->id;
|
||||
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".implode(',',$warehouseStatus).")";
|
||||
if ($conf->global->ENTREPOT_EXTRA_STATUS && count($warehouseStatus)) $sql.= " AND w.statut IN (".$db->escape(implode(',',$warehouseStatus)).")";
|
||||
|
||||
dol_syslog(get_class($this)."::load_stock", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@@ -226,8 +226,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ $arrayfields=array(
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
|
||||
}
|
||||
@@ -217,16 +217,16 @@ if (empty($reshook))
|
||||
$search_accountancy_code_buy='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Product';
|
||||
if ((string) $type == '1') { $objectlabel='Services'; }
|
||||
if ((string) $type == '0') { $objectlabel='Products'; }
|
||||
|
||||
|
||||
$permtoread = $user->rights->produit->lire;
|
||||
$permtodelete = $user->rights->produit->supprimer;
|
||||
$uploaddir = $conf->product->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
|
||||
@@ -321,8 +321,9 @@ else
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@@ -353,10 +354,10 @@ else
|
||||
*/
|
||||
function list_get_product_sellprice($fk_object) {
|
||||
global $langs,$conf, $user;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
if ($object->status)
|
||||
{
|
||||
if ($object->price_base_type == 'TTC') return price($object->price_ttc).' '.$langs->trans("TTC");
|
||||
@@ -371,23 +372,23 @@ else
|
||||
* @param int $fk_object rowid of product
|
||||
* @param string $field concerned field status|status_buy
|
||||
* @param int $type for libstatus
|
||||
* @return string
|
||||
* @return string
|
||||
*/
|
||||
function list_get_product_status($fk_object, $field, $type) {
|
||||
global $conf, $user;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
|
||||
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
|
||||
return ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
|
||||
} else {
|
||||
return $object->LibStatut($object->{$field},5,$type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function return formated ref
|
||||
*
|
||||
@@ -396,14 +397,14 @@ else
|
||||
*/
|
||||
function list_get_product_ref($fk_object) {
|
||||
global $conf, $user;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
|
||||
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
return $object->getNomUrl(1,'',24);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function return formated extrafield
|
||||
*
|
||||
@@ -413,10 +414,10 @@ else
|
||||
*/
|
||||
function list_get_product_extrafield($fk_object, $key) {
|
||||
global $extrafields;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
return $extrafields->showOutputField($key, $object->array_options['options_'.$key], '', 1);
|
||||
}
|
||||
|
||||
@@ -428,12 +429,12 @@ else
|
||||
*/
|
||||
function list_get_product_virtual_stock($fk_object) {
|
||||
global $langs;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
$object->load_stock('nobatch');
|
||||
|
||||
|
||||
$out = '';
|
||||
if ($object->type != 1)
|
||||
{
|
||||
@@ -443,7 +444,7 @@ else
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function return formated stock
|
||||
*
|
||||
@@ -452,17 +453,17 @@ else
|
||||
*/
|
||||
function list_get_product_stock($fk_object) {
|
||||
global $langs;
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
if($object === false) return '';
|
||||
|
||||
|
||||
$out = '';
|
||||
if ($object->type != 1)
|
||||
{
|
||||
if ($object->seuil_stock_alerte != '' && $object->stock_reel< (float) $object->seuil_stock_alerte) $out.= img_warning($langs->trans("StockTooLow")).' ';
|
||||
$out.= (double) $object->stock_reel;
|
||||
}
|
||||
|
||||
|
||||
return $out;
|
||||
}
|
||||
/**
|
||||
@@ -473,12 +474,12 @@ else
|
||||
*/
|
||||
function list_get_product_minbuyprice($fk_object) {
|
||||
global $conf, $user, $langs,$db,$form;
|
||||
|
||||
|
||||
$out = '';
|
||||
|
||||
|
||||
$object = Listview::getCachedOjbect('Product', $fk_object);
|
||||
if($object === false || empty($object->status_buy) ) return '';
|
||||
|
||||
|
||||
$product_fourn =new ProductFournisseur($db);
|
||||
if ($product_fourn->find_min_price_product_fournisseur($fk_object) > 0)
|
||||
{
|
||||
@@ -494,7 +495,7 @@ else
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
// array of customized field function
|
||||
$arrayeval = array(
|
||||
'tobuy'=>'list_get_product_status(@rowid@, "status_buy",1)'
|
||||
@@ -506,7 +507,7 @@ else
|
||||
,'stock'=>'list_get_product_stock(@rowid@)'
|
||||
,'minbuyprice'=>'list_get_product_minbuyprice(@rowid@)'
|
||||
);
|
||||
|
||||
|
||||
// defined list align for field
|
||||
$arrayalign = array(
|
||||
'price'=>'right'
|
||||
@@ -519,13 +520,13 @@ else
|
||||
,'datec'=>'center'
|
||||
,'tms'=>'center'
|
||||
);
|
||||
|
||||
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListMoreFields',$parameters); // Note that $action and $object may have been modified by hook
|
||||
if($reshook) {
|
||||
$arrayfields = $hookmanager->resArray;
|
||||
}
|
||||
|
||||
|
||||
// init title, hidden field (allowed into selected fields), and position
|
||||
$arrayhide = $arraytitle = $arrayposition = array();
|
||||
foreach($arrayfields as $k=>$data) {
|
||||
@@ -537,7 +538,7 @@ else
|
||||
$arrayposition[$f] = empty($data['position']) ? 0 : $data['position'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
@@ -554,7 +555,7 @@ else
|
||||
);
|
||||
if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
|
||||
|
||||
|
||||
// Filter on categories
|
||||
$moreforfilter='';
|
||||
if (! empty($conf->categorie->enabled))
|
||||
@@ -564,7 +565,7 @@ else
|
||||
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
|
||||
//Show/hide child products. Hidden by default
|
||||
if (!empty($conf->variants->enabled) && $type === 0) {
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
@@ -572,16 +573,16 @@ else
|
||||
$moreforfilter.= ' <label for="search_hidechildproducts">'.$langs->trans('HideChildProducts').'</label>';
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
|
||||
if ($moreforfilter)
|
||||
{
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
if(!empty($hookmanager->resPrint)) {
|
||||
$moreforfilter.=$hookmanager->resPrint;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$param='';
|
||||
@@ -609,7 +610,7 @@ else
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
|
||||
//var_dump($arraytitle,$arrayhide);
|
||||
$list=new Listview($db, 'product');
|
||||
$listHTML = $list->render($sql,array(
|
||||
@@ -633,7 +634,7 @@ else
|
||||
,'allow-fields-select'=>1 // allow to select hidden fields
|
||||
,'head_search'=>$moreforfilter //custom search on head
|
||||
,'no-auto-sql-search'=>1 //disabled auto completion sql for search and pager url, use dolibarr style for migration of product list
|
||||
,'translate'=>array()
|
||||
,'translate'=>array()
|
||||
,'search'=>array(
|
||||
'ref'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'sref')
|
||||
,'label'=>array('search_type'=>true, 'table'=>'p', 'fieldname'=>'snom')
|
||||
@@ -650,11 +651,11 @@ else
|
||||
,'hide'=>$arrayhide
|
||||
,'eval'=>$arrayeval
|
||||
));
|
||||
|
||||
|
||||
$num = $list->totalRow;
|
||||
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
|
||||
{
|
||||
$id = $list->TField[0]->rowid;
|
||||
@@ -693,9 +694,9 @@ else
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
|
||||
echo $listHTML;
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -325,8 +325,9 @@ else
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -465,8 +465,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -244,8 +244,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -323,8 +323,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -321,8 +321,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -802,7 +802,7 @@ print '</div>'."\n";
|
||||
print '<br>';
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs);
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
|
||||
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
@@ -156,7 +156,8 @@ print '<div id="dolpaymentdiv" align="center">'."\n";
|
||||
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>\n";
|
||||
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
|
||||
$key='ONLINE_PAYMENT_MESSAGE_KO';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
@@ -115,7 +115,8 @@ dol_syslog("Call newpaymentok with token=".$onlinetoken." paymentType=".$payment
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br><br>\n";
|
||||
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
|
||||
$key='ONLINE_PAYMENT_MESSAGE_OK';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
|
||||
// Appel des triggers
|
||||
|
||||
@@ -1264,6 +1264,7 @@ else
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
print '</div>'."\n";
|
||||
print '<br>';
|
||||
@@ -1446,7 +1447,7 @@ if (preg_match('/^dopayment/',$action))
|
||||
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs);
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
|
||||
@@ -238,7 +238,9 @@ if ($urllogo)
|
||||
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
|
||||
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
|
||||
$key='ONLINE_PAYMENT_MESSAGE_KO';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
|
||||
@@ -285,7 +285,9 @@ if ($ispaymentok)
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
|
||||
|
||||
$key='ONLINE_PAYMENT_MESSAGE_OK';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
$sendemail = '';
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
|
||||
|
||||
@@ -1015,7 +1015,7 @@ print '<br>';
|
||||
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs);
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
|
||||
@@ -166,7 +166,9 @@ print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div id="dolpaymentdiv" align="center">'."\n";
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
|
||||
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
|
||||
$key='ONLINE_PAYMENT_MESSAGE_KO';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
|
||||
@@ -170,7 +170,9 @@ if ($PAYPALTOKEN)
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
|
||||
|
||||
$key='ONLINE_PAYMENT_MESSAGE_OK';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
// Appel des triggers
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2017 Saasprov <saasprov@gmail.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -1084,6 +1085,7 @@ if (preg_match('/^dopayment/',$action))
|
||||
box-shadow: 0 1px 3px 0 #e6ebf1;
|
||||
-webkit-transition: box-shadow 150ms ease;
|
||||
transition: box-shadow 150ms ease;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.StripeElement--focus {
|
||||
@@ -1227,7 +1229,7 @@ if (preg_match('/^dopayment/',$action))
|
||||
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs);
|
||||
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
|
||||
@@ -153,7 +153,9 @@ print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div id="dolpaymentdiv" align="center">'."\n";
|
||||
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
|
||||
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
|
||||
$key='ONLINE_PAYMENT_MESSAGE_KO';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
print "\n</div>\n";
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,9 @@ if ($ispaymentok)
|
||||
|
||||
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
|
||||
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
|
||||
|
||||
$key='ONLINE_PAYMENT_MESSAGE_OK';
|
||||
if (! empty($conf->global->$key)) print $conf->global->$key;
|
||||
|
||||
$sendemail = '';
|
||||
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;
|
||||
|
||||
@@ -76,8 +76,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$filter['ef.'.$tmpkey]=natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -473,12 +473,14 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0'))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
}
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@@ -59,8 +59,10 @@ if ($action == 'setvalue' && $user->admin)
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity);
|
||||
if (! $result > 0) $error++;
|
||||
$result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity);
|
||||
@@ -194,6 +196,12 @@ print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="'.$conf
|
||||
print ' '.$langs->trans("Example").': http://mysite/mycss.css';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageForm").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("MessageOK").'</td><td>';
|
||||
$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');
|
||||
|
||||
@@ -284,7 +284,7 @@ if ($search_montant_vat != '') $sql.= natural_search("sp.tva", $search_montant_v
|
||||
if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant_ttc, 1);
|
||||
if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
|
||||
if ($socid) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$search_status.')';
|
||||
if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')';
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0 && empty($day))
|
||||
@@ -323,8 +323,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -224,8 +224,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user