Merge branch 'develop' into patch-1

This commit is contained in:
Laurent Destailleur 2022-03-07 16:08:31 +01:00 committed by GitHub
commit 6d772b7627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
118 changed files with 695 additions and 380 deletions

View File

@ -3,6 +3,32 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 16.0.0 compared to 15.0.0 *****
For users:
---------------
NEW: ...
Modules
NEW: Experimental module Event Organization Management
NEW: Experimental module Workstations Management
NEW: Experimental module Partnership Management
For developers:
---------------
NEW:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* verifCond('stringtoevaluate') now return false when string contains a bad syntax content instead of true.
***** ChangeLog for 15.0.0 compared to 14.0.0 *****
For users:
@ -10,6 +36,7 @@ For users:
NEW: Online proposal signature
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Provide a special pages for bookmarks and multicompany for a better use of some mobile applications (like DoliDroid)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
NEW: Add option to disable globaly some notifications emails.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.

View File

@ -190,7 +190,7 @@ $arrayfields = array(
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
't.date_validated'=>array('label'=>$langs->trans("DateValidationAndLock"), 'checked'=>1),
);
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
@ -678,19 +678,28 @@ $formconfirm = '';
if ($action == 'export_file') {
$form_question = array();
// If 1 or not set, we check by default.
$checked = (!isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE));
$form_question['notifiedexportdate'] = array(
'name' => 'notifiedexportdate',
'type' => 'checkbox',
'label' => $langs->trans('NotifiedExportDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_EXPORT_DATE) ? 'false' : 'true'),
'value' => $checked,
);
$form_question['separator'] = array('name'=>'separator', 'type'=>'separator');
// If 0 or not set, we NOT check by default.
$checked = (isset($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) || !empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE));
$form_question['notifiedvalidationdate'] = array(
'name' => 'notifiedvalidationdate',
'type' => 'checkbox',
'label' => $langs->trans('NotifiedValidationDate'),
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
'value' => $checked,
);
$form_question['separator2'] = array('name'=>'separator2', 'type'=>'separator');
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
}
@ -823,7 +832,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
// Code journal
if (!empty($arrayfields['t.code_journal']['checked'])) {
print '<td class="liste_titre center">';
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150');
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'small maxwidth150');
print '</td>';
}
// Date document
@ -845,10 +854,10 @@ if (!empty($arrayfields['t.doc_ref']['checked'])) {
if (!empty($arrayfields['t.numero_compte']['checked'])) {
print '<td class="liste_titre">';
print '<div class="nowrap">';
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200', 'account');
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth150', 'account');
print '</div>';
print '<div class="nowrap">';
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200', 'account');
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth150', 'account');
print '</div>';
print '</td>';
}
@ -1125,24 +1134,25 @@ while ($i < min($num, $limit)) {
// Other type
}
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
// Picto + Ref
print '<td class="nobordernopadding nowrap">';
$labeltoshow = '';
$labeltoshowalt = '';
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report') {
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
print $documentlink;
$labeltoshow .= $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
$labeltoshow .= $documentlink;
$labeltoshowalt .= $objectstatic->ref;
} elseif ($line->doc_type == 'bank') {
print $objectstatic->getNomUrl(1);
$labeltoshow .= $objectstatic->getNomUrl(1);
$labeltoshowalt .= $objectstatic->ref;
$bank_ref = strstr($line->doc_ref, '-');
print " " . $bank_ref;
$labeltoshow .= " " . $bank_ref;
$labeltoshowalt .= " " . $bank_ref;
} else {
print $line->doc_ref;
$labeltoshow .= $line->doc_ref;
$labeltoshowalt .= $line->doc_ref;
}
print '</td></tr></table>';
print '<td class="nowraponall tdoverflowmax200" title="'.dol_escape_htmltag($labeltoshowalt).'">';
print $labeltoshow;
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@ -1167,7 +1177,7 @@ while ($i < min($num, $limit)) {
// Label operation
if (!empty($arrayfields['t.label_operation']['checked'])) {
print '<td>'.$line->label_operation.'</td>';
print '<td class="small tdoverflowmax200" title="'.dol_escape_htmltag($line->label_operation).'">'.dol_escape_htmltag($line->label_operation).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1228,7 +1238,7 @@ while ($i < min($num, $limit)) {
// Exported operation date
if (!empty($arrayfields['t.date_export']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_export, 'dayhour').'</td>';
print '<td class="center nowraponall">'.dol_print_date($line->date_export, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}
@ -1236,7 +1246,7 @@ while ($i < min($num, $limit)) {
// Validated operation date
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
print '<td class="center nowraponall">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -13,7 +13,6 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
/**

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedopjectblock.tpl.php -->\n";
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -8,7 +8,7 @@
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
@ -201,7 +201,7 @@ $tabsql = array();
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.rowid";
$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as state_code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite FROM ".MAIN_DB_PREFIX."c_country AS c";
$tabsql[4] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.favorite, c.eec FROM ".MAIN_DB_PREFIX."c_country AS c";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.color, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
@ -1093,6 +1093,45 @@ if ($action == 'disable_favorite') {
}
}
// Is in EEC - Activate
if ($action == 'activate_eec') {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
}
$result = $db->query($sql);
if (!$result) {
dol_print_error($db);
}
}
// Is in EEC - Disable
if ($action == 'disable_eec') {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
} else {
$rowidcol = "rowid";
}
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
} elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET eec = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
}
$result = $db->query($sql);
if (!$result) {
dol_print_error($db);
}
}
/*
* View
@ -1452,6 +1491,7 @@ if ($id) {
if ($id == 4) {
$tdsoffields .= '<td></td>';
$tdsoffields .= '<td></td>';
}
$tdsoffields .= '<td>';
$tdsoffields .= '<input type="hidden" name="id" value="'.$id.'">';
@ -1496,6 +1536,7 @@ if ($id) {
if ($id == 4) {
print '<td></td>';
print '<td></td>';
}
print '<td colspan="3" class="center">';
if ($action != 'edit') {
@ -1569,6 +1610,7 @@ if ($id) {
}
if ($id == 4) {
print '<td></td>';
print '<td></td>';
}
print '<td class="liste_titre"></td>';
print '<td class="liste_titre right" colspan="2">';
@ -1592,10 +1634,10 @@ if ($id) {
// Determines the name of the field in relation to the possible names
// in data dictionaries
$showfield = 1; // By defaut
$showfield = 1; // By default
$cssprefix = '';
$sortable = 1;
$valuetoshow = ucfirst($value); // By defaut
$valuetoshow = ucfirst($value); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
// Special cases
@ -1794,8 +1836,9 @@ if ($id) {
print getTitleFieldOfList($newvaluetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $value : ''), ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, $cssprefix);
}
}
// Favorite - Only activated on country dictionary
// Favorite & EEC - Only activated on country dictionary
if ($id == 4) {
print getTitleFieldOfList($langs->trans("InEEC"), 0, $_SERVER["PHP_SELF"], "eec", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder, '', 0, $langs->trans("CountryIsInEEC"));
print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page ? 'page='.$page.'&' : ''), $param, 'align="center"', $sortfield, $sortorder);
}
@ -2089,10 +2132,19 @@ if ($id) {
}
$url .= '&';
// Favorite
// Favorite & EEC
// Only activated on country dictionary
if ($id == 4) {
print '<td class="nowrap center">';
// Is in EEC
if ($iserasable) {
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->eec].'_eec&token='.newToken().'">'.$actl[$obj->eec].'</a>';
} else {
print $langs->trans("AlwaysActive");
}
print '</td>';
print '<td class="nowrap center">';
// Favorite
if ($iserasable) {
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite&token='.newToken().'">'.$actl[$obj->favorite].'</a>';
} else {

View File

@ -109,11 +109,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = dol_eval($val['visible'], 1);
$visible = dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position']
);
}

View File

@ -1034,7 +1034,7 @@ if ($resql) {
continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled)
}
// Test on 'enabled'
if (!dol_eval($obj->enabled, 1)) {
if (!dol_eval($obj->enabled, 1, 1, '1')) {
$i++;
continue; // Email template not qualified
}

View File

@ -464,7 +464,7 @@ if ($action == 'create') {
}
print '<td><input type="text" name="menuIdParent" value="'.$valtouse.'" class="minwidth300"></td>';
print '<td>'.$langs->trans('DetailMenuIdParent');
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
print ', <span class="opacitymedium">'.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def</span>';
print '</td></tr>';
// Niveau
@ -496,7 +496,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Enabled').'</td>';
print '<td><input type="text" class="minwidth500" name="enabled" value="'.dol_escape_htmltag($menu->enabled).'"></td><td>'.$langs->trans('DetailEnabled');
if (!empty($menu->enabled)) {
print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled, 1)).')';
print ' <span class="opacitymedium">('.$langs->trans("ConditionIsCurrently").':</span> '.yn(dol_eval($menu->enabled, 1, 1, '1')).')';
}
print '</td></tr>';
@ -504,7 +504,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans('Rights').'</td>';
print '<td><input type="text" class="minwidth500" name="perms" value="'.dol_escape_htmltag($menu->perms).'"></td><td>'.$langs->trans('DetailRight');
if (!empty($menu->perms)) {
print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms, 1)).')';
print ' <span class="opacitymedium">('.$langs->trans("ConditionIsCurrently").':</span> '.yn(dol_eval($menu->perms, 1, 1, '1')).')';
}
print '</td></tr>';

View File

@ -304,7 +304,15 @@ if ($mode == 'config' && $user->admin) {
print '<tr class="liste_titre">';
print '<th>'.$langs->trans("Name").'</th>';
print '<th>'.$langs->trans("Type").'</th>';
print '<th>'.$langs->trans("Profile").'</th>';
print '<th>';
$htmltext = $langs->trans("PROFILE_DEFAULT").' = '.$langs->trans("PROFILE_DEFAULT_HELP").'<br>';
$htmltext .= $langs->trans("PROFILE_SIMPLE").' = '.$langs->trans("PROFILE_SIMPLE_HELP").'<br>';
$htmltext .= $langs->trans("PROFILE_EPOSTEP").' = '.$langs->trans("PROFILE_EPOSTEP_HELP").'<br>';
$htmltext .= $langs->trans("PROFILE_P822D").' = '.$langs->trans("PROFILE_P822D_HELP").'<br>';
$htmltext .= $langs->trans("PROFILE_STAR").' = '.$langs->trans("PROFILE_STAR_HELP").'<br>';
print $form->textwithpicto($langs->trans("Profile"), $htmltext);
print '</th>';
print '<th>'.$langs->trans("Parameters").'</th>';
print '<th></th>';
print "</tr>\n";
@ -386,17 +394,6 @@ if ($mode == 'config' && $user->admin) {
print '</table>';
print '<br>';
print load_fiche_titre($langs->trans("ReceiptPrinterProfileDesc"), '', '')."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_DEFAULT").':</td><td>'.$langs->trans("PROFILE_DEFAULT_HELP").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_SIMPLE").':</td><td>'.$langs->trans("PROFILE_SIMPLE_HELP").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_EPOSTEP").':</td><td>'.$langs->trans("PROFILE_EPOSTEP_HELP").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_P822D").':</td><td>'.$langs->trans("PROFILE_P822D_HELP").'</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PROFILE_STAR").':</td><td>'.$langs->trans("PROFILE_STAR_HELP").'</td></tr>';
print '</table>';
}
// mode = template

View File

@ -406,7 +406,7 @@ print '<br><br>';
print '<br>';
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
print load_fiche_titre($langs->trans("OtherSetup"), '', 'folder');
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
@ -439,19 +439,24 @@ print '<br>';
print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
print '<br>';
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 2)</span>'."<br>";
print '<br>';
print '<br>';
print '<br>';
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
print '<br>';
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
print '<br>';
print '<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 2)</span>' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)."<br>";
print '<br>';
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.(empty($conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>' : $conf->global->MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL)."<br>";
print '<br>';
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';

View File

@ -41,7 +41,7 @@ https://**yourdolibarr.tld**/mydolibarr/api/index.php/otherservice?DOLAPIKEY=**a
Develop an API
--------------
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples http://help.luracast.com/restler/examples/
The API uses Lucarast Restler framework. Please check documentation https://www.luracast.com/products/restler and examples https://restler3.luracast.com/examples/index.html
Github contains also useful information : https://github.com/Luracast/Restler

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -106,7 +106,7 @@ foreach ($object->fields as $key => $val) {
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedobjectblock.tpl.php -->\n";
global $user, $db;
global $noMoreLinkedObjectBlockAfter;

View File

@ -160,7 +160,7 @@ if ($action == 'create') {
print '<table class="border centpercent tableforfieldcreate">';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth300" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("SetHereATitleForLink").'</span></td></tr>';
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("BookmarkTitle").'</td><td><input id="titlebookmark" class="flat minwidth250" name="title" value="'.dol_escape_htmltag($title).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("SetHereATitleForLink").'</span></td></tr>';
dol_set_focus('#titlebookmark');
// Url
@ -230,9 +230,9 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
print '</td><td>';
if ($action == 'edit') {
print '<input class="flat minwidth300" name="title" value="'.(GETPOSTISSET("title") ? GETPOST("title", '', 2) : $object->title).'">';
print '<input class="flat minwidth250" name="title" value="'.(GETPOSTISSET("title") ? GETPOST("title", '', 2) : $object->title).'">';
} else {
print $object->title;
print dol_escape_htmltag($object->title);
}
print '</td></tr>';

View File

@ -186,35 +186,55 @@ class CActionComm
$qualified = 1;
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
// $obj->type can be 'system', 'systemauto', 'module', 'moduleauto', 'xxx', 'xxxauto'
// Note: type = system... than type of event is added among other standard events.
// type = module... then type of event is grouped into module defined into module = myobject@mymodule. Example: Event organization or external modules
// type = xxx... then type of event is added into list as a new flat value (not grouped). Example: Agefod external module
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
}
if ($qualified && !empty($obj->module)) {
if ($obj->module == 'invoice' && empty($conf->facture->enabled) && empty($user->facture->lire)) {
$qualified = 0;
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
$qualified = 0;
// Special cases
if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
$qualified = 1;
}
if ($obj->module == 'order' && empty($conf->commande->enabled) && empty($user->commande->lire)) {
$qualified = 0;
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
$qualified = 1;
}
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
$qualified = 0;
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
$qualified = 1;
}
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
$qualified = 0;
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
$qualified = 1;
}
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
$qualified = 0;
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
$qualified = 1;
}
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
$qualified = 0;
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
$qualified = 1;
}
if (preg_match('/@eventorganization/', $obj->module) && empty($conf->eventorganization->enabled) && empty($user->eventorganization->read)) {
$qualified = 0;
// For the generic case with type = 'module...' and module = 'myobject@mymodule'
$regs = array();
if (preg_match('/^module/', $obj->type)) {
if (preg_match('/^(.+)@(.+)$/', $obj->module, $regs)) {
$tmpobject = $regs[1];
$tmpmodule = $regs[2];
//var_dump($user->$tmpmodule);
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled) && (!empty($user->rights->$tmpmodule->read) || !empty($user->rights->$tmpmodule->lire) || !empty($user->rights->$tmpmodule->$tmpobject->read) || !empty($user->rights->$tmpmodule->$tmpobject->lire))) {
$qualified = 1;
}
}
}
if (!preg_match('/^system/', $obj->type) && isset($conf->{$obj->module}) && empty($conf->{$obj->module}->enabled)) {
$qualified = 0;
// For the case type is not 'system...' neither 'module', we just check module is on
if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) {
$tmpmodule = $obj->module;
//var_dump($tmpmodule);
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled)) {
$qualified = 1;
}
}
}

View File

@ -49,10 +49,11 @@ if (empty($conf->global->AGENDA_EXT_NB)) {
}
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
$filter = GETPOST("search_filter", 'alpha', 3) ?GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ?GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ?GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
$showbirthday = empty($conf->use_javascript_ajax) ?GETPOST("showbirthday", "int") : 1;
$check_holiday = GETPOST('check_holiday', 'int');
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
$showbirthday = empty($conf->use_javascript_ajax) ? GETPOST("showbirthday", "int") : 1;
// If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user.
if (empty($filtert) && empty($conf->global->AGENDA_ALL_CALENDARS)) {
@ -207,16 +208,16 @@ if (GETPOST("viewperuser", 'alpha') || $mode == 'show_peruser') {
}
/*
if ($action == 'delete_action' && $user->rights->agenda->delete) {
$event = new ActionComm($db);
$event->fetch($actionid);
$event->fetch_optionals();
$event->fetch_userassigned();
$event->oldcopy = clone $event;
if ($action == 'delete_action' && $user->rights->agenda->delete) {
$event = new ActionComm($db);
$event->fetch($actionid);
$event->fetch_optionals();
$event->fetch_userassigned();
$event->oldcopy = clone $event;
$result = $event->delete();
}
*/
$result = $event->delete();
}
*/
/*
@ -579,10 +580,10 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
$s .= '</script>'."\n";
// Local calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" value="1" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
// Holiday calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"'.($check_holiday ? ' checked' : '').'><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
// External calendars
if (is_array($showextcals) && count($showextcals) > 0) {
@ -607,13 +608,13 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
foreach ($showextcals as $val) {
$htmlname = md5($val['name']);
if (!empty($val['default'])) {
if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) {
$default = "checked";
} else {
$default = '';
}
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> &nbsp; </div>';
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> &nbsp; </div>';
}
}
@ -848,6 +849,7 @@ if ($resql) {
$event->fk_project = $obj->fk_project;
$event->socid = $obj->fk_soc;
$event->thirdparty_id = $obj->fk_soc;
$event->contact_id = $obj->fk_contact;
// Defined date_start_in_calendar and date_end_in_calendar property
@ -890,13 +892,13 @@ if ($resql) {
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt'); // $mois, $jour, $annee has been set for user tz
$daykeyend = dol_mktime(0, 0, 0, $moisend, $jourend, $anneeend, 'gmt'); // $moisend, $jourend, $anneeend has been set for user tz
/*
print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').'<br>';
print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').'<br>';
*/
print 'GMT '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSERREL '.$event->date_start_in_calendar.' '.dol_print_date($event->date_start_in_calendar, 'dayhour', 'tzuserrel').'<br>';
print 'GMT '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'gmt').'<br>';
print 'TZSERVER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzserver').'<br>';
print 'TZUSER '.$event->date_end_in_calendar.' '.dol_print_date($event->date_end_in_calendar, 'dayhour', 'tzuserrel').'<br>';
*/
do {
//if ($event->id==408)
//print 'daykey='.$daykey.' daykeyend='.$daykeyend.' '.dol_print_date($daykey, 'dayhour', 'gmt').' - '.dol_print_date($event->datep, 'dayhour', 'gmt').' '.dol_print_date($event->datef, 'dayhour', 'gmt').'<br>';

View File

@ -554,10 +554,11 @@ class Propal extends CommonObject
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
* @param double $pu_ht_devise Unit price in currency
* @param int $fk_remise_except Id discount if line is from a discount
* @param int $noupdateafterinsertline No update after insert of line
* @return int >0 if OK, <0 if KO
* @see add_product()
*/
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0)
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0, $noupdateafterinsertline = 0)
{
global $mysoc, $conf, $langs;
@ -746,7 +747,9 @@ class Propal extends CommonObject
}
// Mise a jour informations denormalisees au niveau de la propale meme
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
if (empty($noupdateafterinsertline)) {
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
}
if ($result > 0) {
$this->db->commit();
@ -1009,7 +1012,7 @@ class Propal extends CommonObject
*/
public function create($user, $notrigger = 0)
{
global $conf, $hookmanager;
global $conf, $hookmanager, $mysoc;
$error = 0;
$now = dol_now();
@ -1238,7 +1241,10 @@ class Propal extends CommonObject
$line->array_options,
$line->fk_unit,
$origintype,
$originid
$originid,
0,
0,
1
);
if ($result < 0) {
@ -1267,7 +1273,7 @@ class Propal extends CommonObject
if (!$error) {
// Mise a jour infos denormalisees
$resql = $this->update_price(1);
$resql = $this->update_price(1, 'auto', 0, $mysoc);
if ($resql) {
$action = 'update';

View File

@ -30,7 +30,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1369,7 +1369,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to build doc
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
$upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output;
$permissiontoadd = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';

View File

@ -877,7 +877,7 @@ class Commande extends CommonOrder
*/
public function create($user, $notrigger = 0)
{
global $conf, $langs;
global $conf, $langs, $mysoc;
$error = 0;
// Clean parameters
@ -1044,7 +1044,8 @@ class Commande extends CommonOrder
$origintype,
$originid,
0,
$line->ref_ext
$line->ref_ext,
1
);
if ($result < 0) {
if ($result != self::STOCK_NOT_ENOUGH_FOR_ORDER) {
@ -1061,6 +1062,8 @@ class Commande extends CommonOrder
}
}
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
// update ref
$initialref = '(PROV'.$this->id.')';
if (!empty($this->ref)) {
@ -1438,6 +1441,7 @@ class Commande extends CommonOrder
* @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id
* @param double $pu_ht_devise Unit price in currency
* @param string $ref_ext line external reference
* @param int $noupdateafterinsertline No update after insert of line
* @return int >0 if OK, <0 if KO
*
* @see add_product()
@ -1447,7 +1451,7 @@ class Commande extends CommonOrder
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*/
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $ref_ext = '')
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $fk_product = 0, $remise_percent = 0, $info_bits = 0, $fk_remise_except = 0, $price_base_type = 'HT', $pu_ttc = 0, $date_start = '', $date_end = '', $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = null, $pa_ht = 0, $label = '', $array_options = 0, $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $ref_ext = '', $noupdateafterinsertline = 0)
{
global $mysoc, $conf, $langs, $user;
@ -1658,7 +1662,10 @@ class Commande extends CommonOrder
}
// Mise a jour informations denormalisees au niveau de la commande meme
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
if (empty($noupdateafterinsertline)) {
$result = $this->update_price(1, 'auto', 0, $mysoc); // This method is designed to add line from user input so total calculation must be done using 'auto' mode.
}
if ($result > 0) {
$this->db->commit();
return $this->line->id;

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -104,11 +104,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -261,14 +261,14 @@ if (getDolGlobalString("INVOICE_USE_SITUATION") && $conf->global->INVOICE_USE_RE
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$newkey = '';
if (array_key_exists($key, $arrayfields)) { $newkey = $key; } elseif (array_key_exists('t.'.$key, $arrayfields)) { $newkey = 't.'.$key; } elseif (array_key_exists('f.'.$key, $arrayfields)) { $newkey = 'f.'.$key; } elseif (array_key_exists('s.'.$key, $arrayfields)) { $newkey = 's.'.$key; }
if ($newkey) {
$arrayfields[$newkey] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help' => empty($val['help']) ? '' : $val['help'],
);

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblockForRec.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedobjectblockForRec.tpl.php -->\n";
global $user;

View File

@ -41,12 +41,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
// Security check
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
$object = new RemiseCheque($db);
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
@ -63,11 +58,22 @@ if (empty($page) || $page == -1) {
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$dir = $conf->bank->dir_output.'/checkdeposits/';
$upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits";
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
$filteraccountid = GETPOST('accountid', 'int');
$object = new RemiseCheque($db);
// Security check
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
$usercanread = $user->rights->banque->cheque;
$usercancreate = $user->rights->banque->cheque;
$usercandelete = $user->rights->banque->cheque;
/*
@ -241,7 +247,9 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
$langs->load("other");
$file = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'cheque').GETPOST('file');
$filetodelete = GETPOST('file', 'alpha');
$file = $upload_dir.'/'.$filetodelete;
$ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) {
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
@ -634,6 +642,12 @@ if ($action == 'new') {
$i = 1;
if ($num > 0) {
while ($objp = $db->fetch_object($resql)) {
$paymentstatic->id = $objp->pid;
$paymentstatic->ref = $objp->pref;
$accountlinestatic->id = $objp->rowid;
$accountlinestatic->ref = $objp->ref;
print '<tr class="oddeven">';
print '<td class="center">'.$i.'</td>';
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
@ -643,8 +657,6 @@ if ($action == 'new') {
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
// Link to payment
print '<td class="center">';
$paymentstatic->id = $objp->pid;
$paymentstatic->ref = $objp->pref;
if ($paymentstatic->id) {
print $paymentstatic->getNomUrl(1);
} else {
@ -653,8 +665,6 @@ if ($action == 'new') {
print '</td>';
// Link to bank transaction
print '<td class="center">';
$accountlinestatic->id = $objp->rowid;
$accountlinestatic->ref = $objp->ref;
if ($accountlinestatic->id > 0) {
print $accountlinestatic->getNomUrl(1);
} else {
@ -664,10 +674,10 @@ if ($action == 'new') {
// Action button
print '<td class="right">';
if ($object->statut == 0) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=remove&amp;lineid='.$objp->rowid.'">'.img_delete().'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&token='.newToken().'&lineid='.$objp->rowid.'">'.img_delete().'</a>';
}
if ($object->statut == 1 && $objp->statut != 2) {
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=reject_check&amp;lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&token='.newToken().'&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
}
if ($objp->statut == 2) {
print ' &nbsp; '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
@ -723,11 +733,13 @@ print '</div>';
if ($action != 'new') {
if ($object->statut == 1) {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'checkdeposits');
// Documents
$objref = dol_sanitizeFileName($object->ref);
$filedir = $upload_dir.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1);
$genallowed = $usercancreate;
$delallowed = $usercandelete;
print $formfile->showdocuments('remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
print '<br>';
}

View File

@ -615,6 +615,7 @@ class RemiseCheque extends CommonObject
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charseSupprimert_output = $outputlangs->charset_output;
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
if ($result > 0) {
//$outputlangs->charset_output=$sav_charset_output;

View File

@ -83,7 +83,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
}
}
if ($amounts[key($amounts)] <= 0) {
if (empty($amounts[key($amounts)])) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors');
$action = 'create';

View File

@ -334,7 +334,7 @@ if ($modecompta == 'CREANCES-DETTES') {
//var_dump($result);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
$r = dol_eval($result, 1, 1, '1');
//var_dump($r);
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
@ -353,7 +353,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
$r = dol_eval($result, 1, 1, 1);
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['N'] += $r;
@ -367,7 +367,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
$r = dol_eval($result, 1, 1, 1);
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['M'][$k] += $r;
@ -381,7 +381,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$result = strtr($formula, $vars);
//$r = $AccCat->calculate($result);
$r = dol_eval($result, 1);
$r = dol_eval($result, 1, 1, 1);
print '<td class="liste_total right"><span class="amount">'.price($r).'</span></td>';
$sommes[$code]['M'][$k] += $r;

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1579,17 +1579,20 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
$nbok = 0;
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result>0) {
if ($objecttmp->statut == Holiday::STATUS_VALIDATED && $user->id == $objecttmp->fk_validator) {
if ($result > 0) {
if ($objecttmp->statut != Holiday::STATUS_VALIDATED) {
setEventMessages($langs->trans('StatusOfRefMustBe', $objecttmp->ref, $langs->transnoentitiesnoconv('Validated')), null, 'warnings');
continue;
}
if ($user->id == $objecttmp->fk_validator) {
$objecttmp->oldcopy = dol_clone($objecttmp);
$objecttmp->date_valid = dol_now();
$objecttmp->fk_user_valid = $user->id;
$objecttmp->statut = Holiday::STATUS_APPROVED;
$db->begin();
$verif = $objecttmp->approve($user);
if ($verif <= 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
$error++;
@ -1664,14 +1667,9 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
}
}
}
if (!$error) {
$db->commit();
$nbok++;
} else {
$db->rollback();
$action = '';
}
} else {
$langs->load("errors");
setEventMessages($langs->trans('ErrorNotApproverForHoliday', $objecttmp->ref), null, 'errors');
}
} else {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
@ -1683,7 +1681,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
if (!$error) {
if ($nbok > 1) {
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
} else {
} elseif ($nbok == 1) {
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
}
$db->commit();

View File

@ -102,7 +102,7 @@ class box_scheduled_jobs extends ModeleBoxes
while ($i < $num) {
$objp = $this->db->fetch_object($result);
if (dol_eval($objp->test, 1, 1)) {
if (dol_eval($objp->test, 1, 1, '')) {
$nextrun = $this->db->jdate($objp->datenextrun);
if (empty($nextrun)) {
$nextrun = $this->db->jdate($objp->datestart);

View File

@ -5693,12 +5693,12 @@ abstract class CommonObject
$enabled = 1;
if (isset($this->fields[$key]['enabled'])) {
$enabled = dol_eval($this->fields[$key]['enabled'], 1);
$enabled = dol_eval($this->fields[$key]['enabled'], 1, 1, '1');
}
/*$perms = 1;
if (isset($this->fields[$key]['perms']))
{
$perms = dol_eval($this->fields[$key]['perms'], 1);
$perms = dol_eval($this->fields[$key]['perms'], 1, 1, '1');
}*/
if (empty($enabled)) {
continue;
@ -5854,7 +5854,7 @@ abstract class CommonObject
if (!empty($extrafields) && !empty($extrafields->attributes[$this->table_element]['computed'][$key])) {
//var_dump($conf->disable_compute);
if (empty($conf->disable_compute)) {
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0);
$this->array_options["options_".$key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '');
}
}
}
@ -5985,7 +5985,7 @@ abstract class CommonObject
if (!empty($attrfieldcomputed)) {
if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) {
$value = dol_eval($attrfieldcomputed, 1, 0);
$value = dol_eval($attrfieldcomputed, 1, 0, '');
dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG);
$new_array_options[$key] = $value;
} else {
@ -6352,7 +6352,7 @@ abstract class CommonObject
if (!empty($attrfieldcomputed)) {
if (!empty($conf->global->MAIN_STORE_COMPUTED_EXTRAFIELDS)) {
$value = dol_eval($attrfieldcomputed, 1, 0);
$value = dol_eval($attrfieldcomputed, 1, 0, '');
dol_syslog($langs->trans("Extrafieldcomputed")." sur ".$attributeLabel."(".$value.")", LOG_DEBUG);
$this->array_options["options_".$key] = $value;
} else {
@ -7206,7 +7206,7 @@ abstract class CommonObject
if ($computed) {
// Make the eval of compute string
//var_dump($computed);
$value = dol_eval($computed, 1, 0);
$value = dol_eval($computed, 1, 0, '');
}
if (empty($morecss)) {
@ -7731,7 +7731,7 @@ abstract class CommonObject
// Test on 'enabled' ('enabled' is different than 'list' = 'visibility')
$enabled = 1;
if ($enabled && isset($extrafields->attributes[$this->table_element]['enabled'][$key])) {
$enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1);
$enabled = dol_eval($extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '1');
}
if (empty($enabled)) {
continue;
@ -7739,12 +7739,12 @@ abstract class CommonObject
$visibility = 1;
if ($visibility && isset($extrafields->attributes[$this->table_element]['list'][$key])) {
$visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1);
$visibility = dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '1');
}
$perms = 1;
if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) {
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1);
$perms = dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '1');
}
if (($mode == 'create') && abs($visibility) != 1 && abs($visibility) != 3) {

View File

@ -326,20 +326,21 @@ class DolEditor
$out .= 'jQuery(document).ready(function() {
jQuery(".buttonforacesave").click(function() {
console.log("We click on savefile button for component '.$this->htmlname.'");
var aceEditor = window.ace.edit("'.$this->htmlname.'aceeditorid");
console.log("We click on savefile button for component '.dol_escape_js($this->htmlname).'");
var aceEditor = window.ace.edit("'.dol_escape_js($this->htmlname).'aceeditorid");
if (aceEditor) {
var cursorPos = aceEditor.getCursorPosition();
console.log(cursorPos);
//console.log(cursorPos);
if (cursorPos) {
jQuery("#'.$this->htmlname.'_x").val(cursorPos.column);
jQuery("#'.$this->htmlname.'_y").val(cursorPos.row);
jQuery("#'.dol_escape_js($this->htmlname).'_x").val(cursorPos.column);
jQuery("#'.dol_escape_js($this->htmlname).'_y").val(cursorPos.row);
}
//console.log(aceEditor.getSession().getValue());
// Inject content of editor into the original HTML field.
jQuery("#'.$this->htmlname.'").val(aceEditor.getSession().getValue());
/*if (jQuery("#'.$this->htmlname.'").html().length > 0) return true;
jQuery("#'.dol_escape_js($this->htmlname).'").val(aceEditor.getSession().getValue());
/*if (jQuery("#'.dol_escape_js($this->htmlname).'").html().length > 0) return true;
else return false;*/
return true;
} else {
console.log("Failed to retrieve js object ACE from its name");
return false;

View File

@ -642,14 +642,14 @@ class dolReceiptPrinter extends Printer
case 'DOL_PRINT_OBJECT_LINES':
foreach ($object->lines as $line) {
if ($line->fk_product) {
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n");
$this->printer->text($line->ref . $spaces . $line->qty . str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT) . ' ' . str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT) . "\n");
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n \n");
} else {
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - 10 - 1;
$spacestoadd = $nbcharactbyline - strlen($line->description) - strlen($line->qty) - strlen($line->subprice) - 10 - 1;
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
$this->printer->text($line->description.$spaces.$line->qty.' '.str_pad(price($line->subprice), 10, ' ', STR_PAD_LEFT).' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
}
}
break;

View File

@ -921,9 +921,9 @@ class ExtraFields
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
$required = $this->attributes[$extrafieldsobjectkey]['required'][$key];
$param = $this->attributes[$extrafieldsobjectkey]['param'][$key];
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1);
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1');
$langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key];
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
$totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
@ -1511,9 +1511,9 @@ class ExtraFields
$unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key];
$required = $this->attributes[$extrafieldsobjectkey]['required'][$key];
$param = $this->attributes[$extrafieldsobjectkey]['param'][$key];
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1);
$perms = dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1');
$langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key];
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1);
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
} else {
@ -1972,17 +1972,17 @@ class ExtraFields
$enabled = 1;
if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not
$enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1);
$enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1, 1, '1');
}
$visibility = 1;
if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility
$visibility = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
$visibility = dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '1');
}
$perms = 1;
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '1');
}
if (empty($enabled)) {
continue;

View File

@ -4901,7 +4901,7 @@ class Form
$more .= '<div class="tagtr">';
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].' </div><div class="tagtd">';
$more .= '<input type="checkbox" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$moreattr;
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0') {
if (!is_bool($input['value']) && $input['value'] != 'false' && $input['value'] != '0' && $input['value'] != '') {
$more .= ' checked';
}
if (is_bool($input['value']) && $input['value']) {
@ -4957,6 +4957,8 @@ class Form
$moreonecolumn .= '</div>'."\n";
} elseif ($input['type'] == 'hidden') {
// Do nothing more, already added by a previous loop
} elseif ($input['type'] == 'separator') {
$more .= '<br>';
} else {
$more .= 'Error type '.$input['type'].' for the confirm box is not a supported type';
}
@ -5129,7 +5131,7 @@ class Form
$formconfirm .= '<td class="valid">'.$question.'</td>';
$formconfirm .= '<td class="valid center">';
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'">';
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
$formconfirm .= '</td>';
$formconfirm .= '</tr>'."\n";
@ -7523,7 +7525,7 @@ class Form
if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...)
$tmpfieldstoshow = '';
foreach ($objecttmp->fields as $key => $val) {
if (!dol_eval($val['enabled'], 1, 1)) {
if (!dol_eval($val['enabled'], 1, 1, 1, '1')) {
continue;
}
if (!empty($val['showoncombobox'])) {

View File

@ -360,8 +360,8 @@ class FormFile
* This also set the property $this->numoffiles
*
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
* @param string $filedir Directory to scan
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into a subdir of module.
* @param string $filedir Directory to scan (must not end with a /). Example: '/mydolibarrdocuments/facture/FAYYMM-1234'
* @param string $urlsource Url of origin page (for return)
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
* @param int $delallowed Remove is allowed (1/0)

View File

@ -119,7 +119,7 @@ class Menu
{
$nb = 0;
foreach ($this->liste as $val) {
//if (dol_eval($val['enabled'], 1)) $nb++;
//if (dol_eval($val['enabled'], 1, 1, '1')) $nb++;
if (!empty($val['enabled'])) {
$nb++; // $val['enabled'] is already evaluated to 0 or 1, no need for dol_eval()
}

View File

@ -656,7 +656,7 @@ class Translate
return $str;
} else { // Translation is not available
//if ($key[0] == '$') { return dol_eval($key,1); }
//if ($key[0] == '$') { return dol_eval($key, 1, 1, '1'); }
return $this->getTradFromKey($key);
}
}
@ -722,7 +722,7 @@ class Translate
return $str;
} else {
if ($key[0] == '$') {
return dol_eval($key, 1);
return dol_eval($key, 1, 1, '1');
}
return $this->getTradFromKey($key);
}

View File

@ -382,7 +382,7 @@ print '<div class="divadvancedsearchfield center floatnone">';
print '<div class="inline-block"><span class="opacitymedium">'.$langs->trans("StatisticsOn").'</span></div> ';
$newarrayoftype = array();
foreach ($arrayoftype as $key => $val) {
if (dol_eval($val['enabled'], 1)) {
if (dol_eval($val['enabled'], 1, 1, '1')) {
$newarrayoftype[$key] = $arrayoftype[$key];
}
if ($val['langs']) {
@ -443,7 +443,7 @@ if ($mode == 'grid') {
// YAxis
print '<div class="divadvancedsearchfield">';
foreach ($object->fields as $key => $val) {
if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1))) {
if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) {
if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) {
continue;
}
@ -464,7 +464,7 @@ if ($mode == 'grid') {
// Add measure from extrafields
if ($object->isextrafieldmanaged) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1))) {
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) {
$arrayofyaxis['te.'.$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key]);
}
}
@ -866,7 +866,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
// Add main fields of object
foreach ($object->fields as $key => $val) {
if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1))) {
if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) {
$arrayofmesures[$tablealias.'.'.$key.'-sum'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("Sum").')</span>';
$arrayofmesures[$tablealias.'.'.$key.'-average'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("Average").')</span>';
$arrayofmesures[$tablealias.'.'.$key.'-min'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("Minimum").')</span>';
@ -876,7 +876,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
// Add extrafields to Measures
if ($object->isextrafieldmanaged) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1))) {
if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) {
$arrayofmesures[$tablealias.'e.'.$key.'-sum'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' <span class="opacitymedium">('.$langs->trans("Sum").')</span>';
$arrayofmesures[$tablealias.'e.'.$key.'-average'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' <span class="opacitymedium">('.$langs->trans("Average").')</span>';
$arrayofmesures[$tablealias.'e.'.$key.'-min'] = img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' <span class="opacitymedium">('.$langs->trans("Minimum").')</span>';
@ -948,10 +948,10 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
continue;
}
if (isset($val['enabled']) && !dol_eval($val['enabled'], 1)) {
if (isset($val['enabled']) && !dol_eval($val['enabled'], 1, 1, '1')) {
continue;
}
if (isset($val['visible']) && !dol_eval($val['visible'], 1)) {
if (isset($val['visible']) && !dol_eval($val['visible'], 1, 1, '1')) {
continue;
}
if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) {
@ -1048,10 +1048,10 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) {
continue;
}
if (isset($val['enabled']) && !dol_eval($val['enabled'], 1)) {
if (isset($val['enabled']) && !dol_eval($val['enabled'], 1, 1, '1')) {
continue;
}
if (isset($val['visible']) && !dol_eval($val['visible'], 1)) {
if (isset($val['visible']) && !dol_eval($val['visible'], 1, 1, '1')) {
continue;
}
if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) {

View File

@ -8297,7 +8297,7 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
* Verify if condition in string is ok or not
*
* @param string $strToEvaluate String with condition to check
* @return boolean True or False. Note: It returns True if $strToEvaluate is ''
* @return boolean True or False. Note: It returns also True if $strToEvaluate is ''. False if error
*/
function verifCond($strToEvaluate)
{
@ -8308,8 +8308,12 @@ function verifCond($strToEvaluate)
//print $strToEvaluate."<br>\n";
$rights = true;
if (isset($strToEvaluate) && $strToEvaluate !== '') {
$str = 'if(!('.$strToEvaluate.')) { $rights = false; }';
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
//$str = 'if(!('.$strToEvaluate.')) $rights = false;';
//dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition
//var_dump($strToEvaluate);
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition
$rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false);
//var_dump($rights);
}
return $rights;
}
@ -8318,12 +8322,13 @@ function verifCond($strToEvaluate)
* Replace eval function to add more security.
* This function is called by verifCond() or trans() and transnoentitiesnoconv().
*
* @param string $s String to evaluate
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
* @param int $hideerrors 1=Hide errors
* @return mixed Nothing or return result of eval
* @param string $s String to evaluate
* @param int $returnvalue 0=No return (used to execute eval($a=something)). 1=Value of eval is returned (used to eval($something)).
* @param int $hideerrors 1=Hide errors
* @param string $onlysimplestring 0=Accept all chars, 1=Accept only simple string with char 'a-z0-9\s^$_->&|=!?():"\',/' and restrict use of (, 2=Accept also ';' and no restriction on (.
* @return mixed Nothing or return result of eval
*/
function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1')
{
// Only global variables can be changed by eval function and returned to caller
global $db, $langs, $user, $conf, $website, $websitepage;
@ -8335,17 +8340,62 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
global $obj; // To get $obj used into list when dol_eval is used for computed fields and $obj is not yet $object
global $soc; // For backward compatibility
// Replace dangerous char (used for RCE), we allow only PHP variable testing.
// Test on dangerous char (used for RCE), we allow only characters to make PHP variable testing
if ($onlysimplestring == '1') {
// We must accept: '1 && getDolGlobalInt("doesnotexist1") && $conf->global->MAIN_FEATURES_LEVEL'
// We must accept: '$conf->barcode->enabled && preg_match(\'/^(AAA|BBB)/\',$leftmenu)'
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
return '';
}
// TODO We can exclude all () that is not '($db)' and 'getDolGlobalInt(' and 'getDolGlobalString(' and 'preg_match('
// ...
}
} elseif ($onlysimplestring == '2') {
// We must accept: (($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : "Parent project not found"
if (preg_match('/[^a-z0-9\s'.preg_quote('^$_->&|=!?():"\',/;[]', '/').']/i', $s)) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (found chars that are not chars for simplestring): '.$s);
return '';
}
}
}
if (strpos($s, '::') !== false) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (double : char is forbidden): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (double : char is forbidden): '.$s);
return '';
}
}
if (strpos($s, '`') !== false) {
return 'Bad string syntax to evaluate: '.$s;
if ($returnvalue) {
return 'Bad string syntax to evaluate (backtick char is forbidden): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (backtick char is forbidden): '.$s);
return '';
}
}
if (strpos($s, '.') !== false) {
if ($returnvalue) {
return 'Bad string syntax to evaluate (dot char is forbidden): '.$s;
} else {
dol_syslog('Bad string syntax to evaluate (dot char is forbidden): '.$s);
return '';
}
}
// We block use of php exec or php file functions
$forbiddenphpstrings = array('$$');
$forbiddenphpstrings = array_merge($forbiddenphpstrings, array('_ENV', '_SESSION', '_COOKIE', '_GET', '_POST', '_REQUEST'));
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI");
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "unlink", "mkdir", "rmdir", "symlink", "touch", "umask"));
$forbiddenphpfunctions = array("exec", "passthru", "shell_exec", "system", "proc_open", "popen", "eval", "dol_eval", "executeCLI", 'verifCond');
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
$forbiddenphpregex = 'global\s+\$|\b('.implode('|', $forbiddenphpfunctions).')\b';
@ -8359,7 +8409,12 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1)
if (strpos($s, '__forbiddenstring__') !== false) {
dol_syslog('Bad string syntax to evaluate: '.$s, LOG_WARNING);
return 'Bad string syntax to evaluate: '.$s;
if ($returnvalue) {
return 'Bad string syntax to evaluate: '.$s;
} else {
dol_syslog('Bad string syntax to evaluate: '.$s);
return '';
}
}
//print $s."<br>\n";

View File

@ -216,19 +216,19 @@ function dolGetLdapPasswordHash($password, $type = 'md5')
* If GETPOST('action','aZ09') defined, we also check write and delete permission.
* This method check permission on module then call checkUserAccessToObject() for permission on object (according to entity and socid of user).
*
* @param User $user User to check
* @param string $features Features to check (it must be module $object->element. Can be a 'or' check with 'levela|levelb'.
* Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
* This is used to check permission $user->rights->features->...
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany module. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'.
* This is used to check permission $user->rights->features->feature2...
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
* @param int $isdraft 1=The object with id=$objectid is a draft
* @param int $mode Mode (0=default, 1=return with not die)
* @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed.
* @param User $user User to check
* @param string $features Features to check (it must be module $object->element. Can be a 'or' check with 'levela|levelb'.
* Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
* This is used to check permission $user->rights->features->...
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany module. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'.
* This is used to check permission $user->rights->features->feature2...
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
* @param int $isdraft 1=The object with id=$objectid is a draft
* @param int $mode Mode (0=default, 1=return with not die)
* @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed.
* @see dol_check_secure_access_document(), checkUserAccessToObject()
*/
function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0, $mode = 0)
@ -236,6 +236,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
global $db, $conf;
global $hookmanager;
$objectid = ((int) $objectid); // For the case value is coming from a non sanitized user input
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
@ -270,7 +272,6 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
$features = 'produit';
}
// Get more permissions checks from hooks
$parameters = array('features'=>$features, 'originalfeatures'=>$originalfeatures, 'objectid'=>$objectid, 'dbt_select'=>$dbt_select, 'idtype'=>$dbt_select, 'isdraft'=>$isdraft);
$reshook = $hookmanager->executeHooks('restrictedArea', $parameters);
@ -288,10 +289,6 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
return 1;
}
if ($dbt_select != 'rowid' && $dbt_select != 'id') {
$objectid = "'".$objectid."'";
}
// Features/modules to check
$featuresarray = array($features);
if (preg_match('/&/', $features)) {

View File

@ -126,8 +126,7 @@ abstract class ModeleNumRefChequeReceipts
}
/**
* \class ModeleChequeReceipts
* \brief Classe mere des modeles de
* Class parent for templates of document generation
*/
abstract class ModeleChequeReceipts extends CommonDocGenerator
{

View File

@ -256,7 +256,7 @@ class modAccounting extends DolibarrModules
$r++;
$this->export_code[$r] = $this->rights_class.'_'.$r;
$this->export_label[$r] = 'Chartofaccounts';
$this->export_icon[$r] = 'accounting';
$this->export_icon[$r] = $this->picto;
$this->export_permission[$r] = array(array("accounting", "chartofaccount"));
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');

View File

@ -33,7 +33,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
*/
class modBarcode extends DolibarrModules
{
/**
* Constructor. Define names, constants, directories, boxes, permissions
*
@ -94,6 +93,7 @@ class modBarcode extends DolibarrModules
// Main menu entries
$r = 0;
// A menu entry for the Tools top menu
$this->menu[$r] = array(
'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'mainmenu'=>'tools',
@ -111,6 +111,7 @@ class modBarcode extends DolibarrModules
);
$r++;
// A menu entry for the left menu
$this->menu[$r] = array(
'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry

View File

@ -312,7 +312,8 @@ class modFournisseur extends DolibarrModules
'f.rowid'=>"InvoiceId", 'f.ref'=>"InvoiceRef", 'f.ref_supplier'=>"RefSupplier", 'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice", 'f.date_lim_reglement'=>'DateMaxPayment',
'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus', 'f.note_public'=>"InvoiceNote",
'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription", 'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.remise_percent'=>"Discount", 'fd.total_ht'=>"LineTotalHT",
'fd.total_ttc'=>"LineTotalTTC", 'fd.tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.fk_product'=>'ProductId',
'fd.total_ttc'=>"LineTotalTTC", 'fd.tva'=>"LineTotalVAT", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.fk_product'=>'ProductId',
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'p.accountancy_code_buy'=>'ProductAccountancyBuyCode', 'project.rowid'=>'ProjectId',
'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
);
@ -333,7 +334,8 @@ class modFournisseur extends DolibarrModules
's.nom'=>'Text', 'ps.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text',
's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', 'f.ref'=>"Text", 'f.ref_supplier'=>"Text", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>'Date',
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.paye'=>"Boolean", 'f.fk_statut'=>'Status', 'f.note_public'=>"Text", 'fd.description'=>"Text", 'fd.tva_tx'=>"Text",
'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.tva'=>"Numeric", 'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label',
'fd.qty'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.tva'=>"Numeric", 'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>"Numeric",
'fd.product_type'=>'Numeric', 'fd.fk_product'=>'List:product:label',
'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text'
);
$this->export_entities_array[$r] = array(
@ -341,7 +343,8 @@ class modFournisseur extends DolibarrModules
's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', 'f.rowid'=>"invoice",
'f.ref'=>"invoice", 'f.ref_supplier'=>"invoice", 'f.datec'=>"invoice", 'f.datef'=>"invoice", 'f.date_lim_reglement'=>'invoice', 'f.total_ht'=>"invoice", 'f.total_ttc'=>"invoice", 'f.total_tva'=>"invoice",
'f.paye'=>"invoice", 'f.fk_statut'=>'invoice', 'f.note_public'=>"invoice", 'fd.rowid'=>'invoice_line', 'fd.description'=>"invoice_line", 'fd.tva_tx'=>"invoice_line", 'fd.qty'=>"invoice_line",
'fd.remise_percent'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva'=>"invoice_line", 'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product',
'fd.remise_percent'=>"invoice_line", 'fd.total_ht'=>"invoice_line", 'fd.total_ttc'=>"invoice_line", 'fd.tva'=>"invoice_line", 'fd.date_start'=>"invoice_line", 'fd.date_end'=>"invoice_line", 'fd.special_code'=>"invoice_line",
'fd.product_type'=>'invoice_line', 'fd.fk_product'=>'product',
'p.ref'=>'product', 'p.label'=>'product', 'p.accountancy_code_buy'=>'product', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project'
);
$this->export_dependencies_array[$r] = array('invoice_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
@ -451,7 +454,8 @@ class modFournisseur extends DolibarrModules
'f.total_ht'=>"TotalHT", 'f.total_ttc'=>"TotalTTC", 'f.total_tva'=>"TotalVAT", 'f.fk_statut'=>'Status', 'f.date_valid'=>'DateValidation', 'f.date_approve'=>'DateApprove', 'f.date_approve2'=>'DateApprove2',
'f.note_public'=>"NotePublic", 'f.note_private'=>"NotePrivate", 'uv.login'=>'UserValidation', 'ua1.login'=>'ApprovedBy', 'ua2.login'=>'ApprovedBy2', 'fd.rowid'=>'LineId', 'fd.description'=>"LineDescription",
'fd.tva_tx'=>"LineVATRate", 'fd.qty'=>"LineQty", 'fd.remise_percent'=>"Discount", 'fd.total_ht'=>"LineTotalHT", 'fd.total_ttc'=>"LineTotalTTC",
'fd.total_tva'=>"LineTotalVAT", 'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId',
'fd.total_tva'=>"LineTotalVAT", 'fd.date_start'=>"DateStart", 'fd.date_end'=>"DateEnd", 'fd.special_code'=>'SpecialCode',
'fd.product_type'=>'TypeOfLineServiceOrProduct', 'fd.ref'=>'RefSupplier', 'fd.fk_product'=>'ProductId',
'p.ref'=>'ProductRef', 'p.label'=>'ProductLabel', 'project.rowid'=>'ProjectId', 'project.ref'=>'ProjectRef', 'project.title'=>'ProjectLabel'
);
if (!empty($conf->multicurrency->enabled)) {
@ -471,13 +475,15 @@ class modFournisseur extends DolibarrModules
'f.date_creation'=>"Date", 'f.date_commande'=>"Date", 'f.date_livraison'=>"Date", 'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric",
'f.fk_statut'=>'Status', 'f.date_valid'=>'Date', 'f.date_approve'=>'Date', 'f.date_approve2'=>'Date', 'f.note_public'=>"Text", 'f.note_private'=>"Text", 'fd.description'=>"Text",
'fd.tva_tx'=>"Numeric", 'fd.qty'=>"Numeric", 'fd.remise_percent'=>"Numeric", 'fd.total_ht'=>"Numeric", 'fd.total_ttc'=>"Numeric", 'fd.total_tva'=>"Numeric",
'fd.date_start'=>"Date", 'fd.date_end'=>"Date", 'fd.special_code'=>"Numeric",
'fd.product_type'=>'Numeric', 'fd.ref'=>'Text', 'fd.fk_product'=>'List:product:label', 'p.ref'=>'Text', 'p.label'=>'Text', 'project.ref'=>'Text', 'project.title'=>'Text'
);
$this->export_entities_array[$r] = array(
's.rowid'=>"company", 's.nom'=>'company', 'ps.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', 'c.code'=>'company', 's.phone'=>'company', 's.siren'=>'company',
's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', 's.tva_intra'=>'company', 'uv.login'=>'user', 'ua1.login'=>'user',
'ua2.login'=>'user', 'fd.rowid'=>'order_line', 'fd.description'=>"order_line", 'fd.tva_tx'=>"order_line", 'fd.qty'=>"order_line", 'fd.remise_percent'=>"order_line",
'fd.total_ht'=>"order_line", 'fd.total_ttc'=>"order_line", 'fd.total_tva'=>"order_line", 'fd.product_type'=>'order_line', 'fd.ref'=>'order_line', 'fd.fk_product'=>'product',
'fd.total_ht'=>"order_line", 'fd.total_ttc'=>"order_line", 'fd.total_tva'=>"order_line", 'fd.date_start'=>"order_line", 'fd.date_end'=>"order_line", 'fd.special_code'=>"order_line",
'fd.product_type'=>'order_line', 'fd.ref'=>'order_line', 'fd.fk_product'=>'product',
'p.ref'=>'product', 'p.label'=>'product', 'project.rowid'=>'project', 'project.ref'=>'project', 'project.title'=>'project'
);
$this->export_dependencies_array[$r] = array('order_line'=>'fd.rowid', 'product'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@ -5,6 +5,7 @@
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -480,7 +481,6 @@ class modSociete extends DolibarrModules
's.fax' => "Fax",
's.url' => "Url",
's.email' => "Email",
's.skype' => "Skype",
's.fk_effectif' => "Staff",
's.fk_typent' => "ThirdPartyType",
"s.fk_forme_juridique" => "JuridicalStatus",
@ -621,7 +621,6 @@ class modSociete extends DolibarrModules
's.fax' => "eg. +34987654321",
's.url' => "e.g. https://www.mybigcompany.com",
's.email' => "e.g. test@mybigcompany.com",
's.skype' => "Skype name",
's.fk_effectif' => "1/2/3/5: represents one of the five ranges of employees",
's.fk_typent' => 'matches field "id" (1-9 etc.) OR "code" (TE_SMALL etc.) in table "'.MAIN_DB_PREFIX.'c_typent"',
's.fk_forme_juridique' => '1/2/3 etc...matches field "code" in table "'.MAIN_DB_PREFIX.'c_forme_juridique"',
@ -693,7 +692,6 @@ class modSociete extends DolibarrModules
's.phone_mobile' => "PhoneMobile",
's.fax' => "Fax",
's.email' => "Email",
's.skype' => "Skype",
's.note_private' => "NotePrivate",
's.note_public' => "NotePublic"
);
@ -759,7 +757,6 @@ class modSociete extends DolibarrModules
's.phone_mobile' => "5551144",
's.fax' => "5551155",
's.email' => "johnsmith@email.com",
's.skype' => "skype username",
's.note_private' => "My private note",
's.note_public' => "My public note"
);

View File

@ -73,7 +73,7 @@ print "</tr>\n";
if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) {
foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) {
/*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1)) {
/*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) {
// TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled"
// continue;
}*/

View File

@ -23,9 +23,9 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
$arrayfields[$extrafieldsobjectprefix.$key] = array(
'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key],
'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key],
'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1) <= 0) ? 0 : 1),
'checked' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? 0 : 1),
'position' => $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key],
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1)),
'enabled' => (abs((int) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key]) != 3 && dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1')),
'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key],
'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key],
);

View File

@ -38,7 +38,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
//var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]);
//var_dump($obj);
//var_dump($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key]);
$value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1);
$value = dol_eval($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key], 1, 1, '0');
//var_dump($value);
}

View File

@ -212,14 +212,14 @@ if ($massaction == 'presend') {
}
if ($massaction == 'preenable') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, '', 0, 200, 500, 1);
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, 'yes', 0, 200, 500, 1);
}
if ($massaction == 'predisable') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
}
if ($massaction == 'preapproveleave') {
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, '', 0, 200, 500, 1);
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1);
}
// Allow Pre-Mass-Action hook (eg for confirmation dialog)

View File

@ -19,7 +19,7 @@
*
*/
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
global $user;
global $noMoreLinkedObjectBlockAfter;

View File

@ -327,7 +327,11 @@ class EcmFiles extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
$this->errors[] = 'Error '.$this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->errors[] = 'Error DB_ERROR_RECORD_ALREADY_EXISTS : '.$this->db->lasterror();
} else {
$this->errors[] = 'Error '.$this->db->lasterror();
}
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
}

View File

@ -114,11 +114,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -122,11 +122,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedopjectblock.tpl.php -->\n";
echo "<!-- BEGIN PHP TEMPLATE eventorganization/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1208,6 +1208,7 @@ if ($action == 'create') {
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" class="qtyl center" type="text" size="4" value="'.$deliverableQty.'">';
} else {
if (! empty($conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) {
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
print '<input name="qtyl'.$indiceAsked.'" id="qtyl'.$indiceAsked.'" type="hidden" value="0">';
}

View File

@ -367,13 +367,15 @@ class Expedition extends CommonObject
// Insert of lines
$num = count($this->lines);
for ($i = 0; $i < $num; $i++) {
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
$error++;
}
} else { // with batch management
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
$error++;
if (empty($this->lines[$i]->product_type) || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
$error++;
}
} else { // with batch management
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
$error++;
}
}
}
}
@ -913,6 +915,7 @@ class Expedition extends CommonObject
// Copy the rang of the order line to the expedition line
$line->rang = $orderline->rang;
$line->product_type = $orderline->product_type;
if (!empty($conf->stock->enabled) && !empty($orderline->fk_product)) {
$fk_product = $orderline->fk_product;
@ -965,6 +968,8 @@ class Expedition extends CommonObject
}
$this->lines[$num] = $line;
return 1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2611,6 +2616,12 @@ class ExpeditionLigne extends CommonObjectLine
*/
public $product_desc;
/**
* Type of the product. 0 for product, 1 for service
* @var int
*/
public $product_type = 0;
/**
* @var int rang of line
*/

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE expedition/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE expensereport/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE expensereport/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE fichinter/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE fichinter/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -477,15 +477,15 @@ class CommandeFournisseur extends CommonOrder
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND pfp.fk_soc = ".((int) $this->socid);
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND l.fk_product = pfp.fk_product and l.ref = pfp.ref_fourn AND l.qty >= pfp.quantity AND pfp.fk_soc = ".((int) $this->socid);
}
$sql .= " WHERE l.fk_commande = ".((int) $this->id);
if ($only_product) {
$sql .= ' AND p.fk_product_type = 0';
}
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql.= " AND l.qty >= pfp.quantity ";
$sql.= " GROUP BY l.rowid HAVING max_qty = MAX(pfp.quantity) ";
$sql.= " GROUP BY l.rowid";
$sql.= " HAVING (max_qty = MAX(pfp.quantity) OR max_qty IS NULL)";
}
$sql .= " ORDER BY l.rang, l.rowid";
//print $sql;
@ -3552,11 +3552,11 @@ class CommandeFournisseurLigne extends CommonOrderLine
$sql .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as cd';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pfp.entity IN (".getEntity('product_fournisseur_price').") AND cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn AND cd.qty >= pfp.quantity";
}
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " AND cd.qty >= pfp.quantity GROUP BY cd.rowid HAVING max_qty = MAX(pfp.quantity)";
$sql .= " GROUP BY cd.rowid HAVING (max_qty = MAX(pfp.quantity) OR max_qty IS NULL)";
}
$result = $this->db->query($sql);
if ($result) {

View File

@ -12,7 +12,7 @@
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -245,7 +245,7 @@ class FactureFournisseur extends CommonInvoice
public $multicurrency_total_ht;
public $multicurrency_total_tva;
public $multicurrency_total_ttc;
//! id of source var_dump($$this);invoice if replacement invoice or credit note
//! id of source invoice if replacement invoice or credit note
/**
* @var int ID
*/

View File

@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE fourn/facture/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE fourn/facture/tpl/linkedobjectblock.tpl.php -->\n";
global $user;

View File

@ -1083,7 +1083,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
if (empty($include_users)) {
print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
} else {
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator); // Will work only if supervisor has permission to approve so is inside include_users
// Defined default approver (the forced approved of user or the supervisor if no forced value defined)
// Note: This use will be set only if the deinfed approvr has permission to approve so is inside include_users
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
$defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
}

View File

@ -114,11 +114,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -114,11 +114,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -357,11 +357,11 @@ function DisplayPositionList()
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.' . $key] = array(
'label' => $val['label'],
'checked' => (($visible < 0) ? 0 : 1),
'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);

View File

@ -114,11 +114,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -535,11 +535,11 @@ if ($action != "create" && $action != "edit") {
foreach ($objectline->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.' . $key] = array(
'label' => $val['label'],
'checked' => (($visible < 0) ? 0 : 1),
'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position' => $val['position'],
'help' => isset($val['help']) ? $val['help'] : ''
);

View File

@ -114,11 +114,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -43,6 +43,8 @@ create table llx_commande_fournisseur_dispatch_extrafields
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande_fournisseur_dispatch_extrafields (fk_object);
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1;
UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA';
create table llx_c_shipment_package_type

View File

@ -566,7 +566,8 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_customers_outstanding_bill_reached.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_customers_outstanding_bill_reached.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_scheduled_jobs.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_scheduled_jobs.php' AND entity = 1);
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;

View File

@ -84,6 +84,9 @@ UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'a
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo';
DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo');
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
-- For v14

View File

@ -35,6 +35,9 @@
-- VMYSQL4.3 ALTER TABLE llx_partnership MODIFY COLUMN date_partnership_end date NULL;
-- VPGSQL8.2 ALTER TABLE llx_partnership ALTER COLUMN date_partnership_end DROP NOT NULL;
ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN packaging varchar(64) DEFAULT NULL;
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN date_export datetime DEFAULT NULL;
ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD COLUMN fk_project integer NOT NULL;

View File

@ -274,4 +274,9 @@ ALTER TABLE llx_bank_account ADD COLUMN pti_in_ctti smallint DEFAULT 0 AFTER dom
-- Set default ticket type to OTHER if no default exists
UPDATE llx_c_ticket_type SET use_default=1 WHERE code='OTHER' AND NOT EXISTS(SELECT * FROM (SELECT * FROM llx_c_ticket_type) AS t WHERE use_default=1);
ALTER TABLE llx_propal ADD last_main_doc VARCHAR(255) NULL AFTER model_pdf;
UPDATE llx_c_country SET eec=0 WHERE eec IS NULL;
ALTER TABLE llx_c_country MODIFY COLUMN eec tinyint DEFAULT 0 NOT NULL;

View File

@ -24,8 +24,8 @@ create table llx_c_country
rowid integer PRIMARY KEY,
code varchar(2) NOT NULL,
code_iso varchar(3) ,
label varchar(128) NOT NULL,
eec integer ,
label varchar(128) NOT NULL,
eec tinyint DEFAULT 0 NOT NULL,
active tinyint DEFAULT 1 NOT NULL,
favorite tinyint DEFAULT 0 NOT NULL
)ENGINE=innodb;

View File

@ -50,8 +50,7 @@ create table llx_product_fournisseur_price
import_key varchar(14), -- Import key
delivery_time_days integer,
supplier_reputation varchar(10),
packaging varchar(64),
packaging varchar(64) DEFAULT NULL,
fk_multicurrency integer,
multicurrency_code varchar(3),
multicurrency_tx double(24,8) DEFAULT 1,

View File

@ -124,11 +124,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -219,12 +219,12 @@ ByPredefinedAccountGroups=By predefined groups
ByPersonalizedAccountGroups=By personalized groups
ByYear=By year
NotMatch=Not Set
DeleteMvt=Delete some operation lines from accounting
DeleteMvt=Delete some lines from accounting
DelMonth=Month to delete
DelYear=Year to delete
DelJournal=Journal to delete
ConfirmDeleteMvt=This will delete all operation lines of the accounting for the year/month and/or for a specific journal (At least one criterion is required). You will have to reuse the feature '%s' to have the deleted record back in the ledger.
ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all operation lines related to the same transaction will be deleted)
ConfirmDeleteMvt=This will delete all lines in accountancy for the year/month and/or for a specific journal (At least one criterion is required). You will have to reuse the feature '%s' to have the deleted record back in the ledger.
ConfirmDeleteMvtPartial=This will delete the transaction from the accounting (all lines related to the same transaction will be deleted)
FinanceJournal=Finance journal
ExpenseReportsJournal=Expense reports journal
DescFinanceJournal=Finance journal including all the types of payments by bank account
@ -282,7 +282,7 @@ DescClosure=Consult here the number of movements by month who are not validated
OverviewOfMovementsNotValidated=Step 1/ Overview of movements not validated. (Necessary to close a fiscal year)
AllMovementsWereRecordedAsValidated=All movements were recorded as validated
NotAllMovementsCouldBeRecordedAsValidated=Not all movements could be recorded as validated
ValidateMovements=Validate movements
ValidateMovements=Validate and lock record...
DescValidateMovements=Any modification or deletion of writing, lettering and deletes will be prohibited. All entries for an exercise must be validated otherwise closing will not be possible
ValidateHistory=Bind Automatically
@ -301,7 +301,7 @@ Accounted=Accounted in ledger
NotYetAccounted=Not yet transferred to accounting
ShowTutorial=Show Tutorial
NotReconciled=Not reconciled
WarningRecordWithoutSubledgerAreExcluded=Warning, all operations without subledger account defined are filtered and excluded from this view
WarningRecordWithoutSubledgerAreExcluded=Warning, all lines without subledger account defined are filtered and excluded from this view
## Admin
BindingOptions=Binding options
@ -329,8 +329,9 @@ ACCOUNTING_DISABLE_BINDING_ON_PURCHASES=Disable binding & transfer in accountanc
ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS=Disable binding & transfer in accountancy on expense reports (expense reports will not be taken into account in accounting)
## Export
NotifiedExportDate=Flag exported lines as exported (modification of the lines will not be possible)
NotifiedValidationDate=Validate the exported entries (modification or deletion of the lines will not be possible)
NotifiedExportDate=Flag exported lines as Exported <span class="warning">(to modify a line, you will need to delete the whole transaction and re-transfert it into accounting)</span>
NotifiedValidationDate=Validate and Lock the exported entries <span class="warning">(same effect than the "Closure" feature, modification and deletion of the lines will DEFINITELY not be possible)</span>
DateValidationAndLock=Date validation and lock
ConfirmExportFile=Confirmation of the generation of the accounting export file ?
ExportDraftJournal=Export draft journal
Modelcsv=Model of export

View File

@ -278,6 +278,7 @@ ErrorIsNotADraft=%s is not a draft
ErrorExecIdFailed=Can't execute command "id"
ErrorBadCharIntoLoginName=Unauthorized character in the login name
ErrorRequestTooLarge=Error, request too large
ErrorNotApproverForHoliday=You are not the approver for leave %s
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.

View File

@ -7,7 +7,7 @@ TestSentToPrinter=Test Sent To Printer %s
ReceiptPrinter=Receipt printers
ReceiptPrinterDesc=Setup of receipt printers
ReceiptPrinterTemplateDesc=Setup of Templates
ReceiptPrinterTypeDesc=Description of Receipt Printer's type
ReceiptPrinterTypeDesc=Example of possible values for the field "Parameters" according to the type of driver
ReceiptPrinterProfileDesc=Description of Receipt Printer's Profile
ListPrinters=List of Printers
SetupReceiptTemplate=Template Setup

View File

@ -432,7 +432,7 @@ class modMyModule extends DolibarrModules
$sql = array();
// Document templates
$moduledir = 'mymodule';
$moduledir = dol_sanitizeFileName('mymodule');
$myTmpObjects = array();
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
@ -441,8 +441,8 @@ class modMyModule extends DolibarrModules
continue;
}
if ($myTmpObjectArray['includerefgeneration']) {
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt';
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
$dest = $dirodt.'/template_myobjects.odt';
if (file_exists($src) && !file_exists($dest)) {

View File

@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) {
}
print "<!-- BEGIN PHP TEMPLATE mymodule/core/tpl/linkedopjectblock_myobject.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE mymodule/core/tpl/linkedobjectblock_myobject.tpl.php -->\n";
global $user;

View File

@ -113,8 +113,8 @@ class Mo extends CommonObject
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>500, 'notnull'=>1,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'),
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),

View File

@ -109,11 +109,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
print "<!-- BEGIN PHP TEMPLATE mrp/tpl/linkedopjectblock.tpl.php -->\n";
print "<!-- BEGIN PHP TEMPLATE mrp/tpl/linkedobjectblock.tpl.php -->\n";
global $user, $db;
global $noMoreLinkedObjectBlockAfter;

View File

@ -118,11 +118,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -150,25 +150,8 @@ if ($action == 'other') {
$value = GETPOST('activate_FillProductDescAuto', 'alpha');
$res = dolibarr_set_const($db, "PRODUIT_AUTOFILL_DESC", $value, 'chaine', 0, '', $conf->entity);
if ($value) {
$sql_test = "SELECT count(desc_fourn) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
$resql = $db->query($sql_test);
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') { // if the field does not exist, we create it
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN desc_fourn text";
$resql_new = $db->query($sql_new);
}
}
$value = GETPOST('activate_useProdSupplierPackaging', 'alpha');
$res = dolibarr_set_const($db, "PRODUCT_USE_SUPPLIER_PACKAGING", $value, 'chaine', 0, '', $conf->entity);
if ($value) {
$sql_test = "SELECT count(packaging) as cpt FROM ".MAIN_DB_PREFIX."product_fournisseur_price WHERE 1";
$resql = $db->query($sql_test);
if (!$resql && $db->lasterrno == 'DB_ERROR_NOSUCHFIELD') { // if the field does not exist, we create it
$sql_new = "ALTER TABLE ".MAIN_DB_PREFIX."product_fournisseur_price ADD COLUMN packaging double(24,8) DEFAULT 1";
$resql_new = $db->query($sql_new);
}
}
}
if ($action == 'specimen') { // For products

View File

@ -272,7 +272,7 @@ class Product extends CommonObject
public $fk_default_bom;
/**
* We must manage lot/batch number, sell-by date and so on : '1':yes '0':no
* We must manage lot/batch number, sell-by date and so on : '0':no, '1':yes, '2": yes with unique serial number
*
* @var int
*/
@ -1979,7 +1979,10 @@ class Product extends CommonObject
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,";
$sql .= " pfp.packaging";
$sql .= " FROM ".$this->db->prefix()."product_fournisseur_price as pfp";
$sql .= " WHERE pfp.fk_product = ".((int) $product_id);
$sql .= " WHERE 1 = 1";
if ($product_id > 0) {
$sql .= " AND pfp.fk_product = ".((int) $product_id);
}
if ($fourn_ref != 'none') {
$sql .= " AND pfp.ref_fourn = '".$this->db->escape($fourn_ref)."'";
}

View File

@ -102,11 +102,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : ''
);

View File

@ -250,11 +250,11 @@ $arrayfields = array(
/*foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = dol_eval($val['visible'], 1);
$visible = dol_eval($val['visible'], 1, 1, '1');
$arrayfields['p.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position']
);
}

View File

@ -117,11 +117,11 @@ $arrayfields = array(
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = (int) dol_eval($val['visible'], 1);
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position'],
'help'=> isset($val['help']) ? $val['help'] : 'help'
);

View File

@ -104,11 +104,11 @@ $arrayfields = array();
foreach ($object->fields as $key => $val) {
// If $val['visible']==0, then we never show the field
if (!empty($val['visible'])) {
$visible = dol_eval($val['visible'], 1);
$visible = dol_eval($val['visible'], 1, 1, '1');
$arrayfields['t.'.$key] = array(
'label'=>$val['label'],
'checked'=>(($visible < 0) ? 0 : 1),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
'position'=>$val['position']
);
}

View File

@ -27,6 +27,7 @@
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';

View File

@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array('projects', 'other'));
$hookmanager->initHooks(array('projectcarddocument'));
$action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');

View File

@ -62,6 +62,8 @@ if (GETPOST('actioncode', 'array')) {
}
$search_agenda_label = GETPOST('search_agenda_label');
$hookmanager->initHooks(array('projectcardinfo'));
// Security check
$id = GETPOST("id", 'int');
$socid = 0;

Some files were not shown because too many files have changed in this diff Show More