Merge branch '13.0' of github.com:Dolibarr/dolibarr into 13.0
This commit is contained in:
commit
4399e55204
@ -29,7 +29,6 @@
|
||||
"ckeditor/ckeditor" : "4.12.1",
|
||||
"mike42/escpos-php" : "2.2",
|
||||
"mobiledetect/mobiledetectlib" : "2.8.34",
|
||||
"phpoffice/phpexcel" : "1.8.1",
|
||||
"restler/framework" : "3.0.0-RC6",
|
||||
"tecnickcom/tcpdf" : "6.3.2",
|
||||
"nnnick/chartjs" : "^2.9",
|
||||
|
||||
@ -32,12 +32,14 @@ base=$2;
|
||||
port=$3;
|
||||
demologin=$4;
|
||||
demopass=$5;
|
||||
demopasshash=$6;
|
||||
|
||||
# ----------------------------- check params
|
||||
if [ "x$confirm" != "xconfirm" ]
|
||||
then
|
||||
echo "----- $0 -----"
|
||||
echo "Usage: initdemopassword.sh confirm [base port login pass]"
|
||||
echo "Usage: initdemopassword.sh confirm [base port login pass password_hash_algo]"
|
||||
echo "password_hash_algo can be md5 of password_hash"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -148,7 +150,15 @@ fi
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
echo "echo \"UPDATE llx_user SET pass_crypted = MD5('$demopass') WHERE login = '$demologin';\" | mysql -P$port $base"
|
||||
echo "UPDATE llx_user SET pass_crypted = MD5('$demopass') WHERE login = '$demologin';" | mysql -P$port $base
|
||||
|
||||
if [ "x$demopasshash" != "xpassword_hash" ]
|
||||
then
|
||||
newpass=`echo '<?php echo md5("$demopass"); ?>' | php`
|
||||
else
|
||||
newpass=`echo '<?php echo password_hash("$demopass", PASSWORD_DEFAULT); ?>' | php`
|
||||
fi
|
||||
|
||||
echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base
|
||||
export res=$?
|
||||
|
||||
if [ $res -ne 0 ]; then
|
||||
|
||||
@ -48,6 +48,9 @@ $search_pcgtype = GETPOST('search_pcgtype', 'alpha');
|
||||
|
||||
$chartofaccounts = GETPOST('chartofaccounts', 'int');
|
||||
|
||||
$permissiontoadd = $user->rights->accounting->chartofaccount;
|
||||
$permissiontodelete = $user->rights->accounting->chartofaccount;
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) accessforbidden();
|
||||
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
||||
@ -79,7 +82,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['aa.reconcilable'
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -107,10 +109,8 @@ if (empty($reshook))
|
||||
$search_array_options = array();
|
||||
}
|
||||
if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on
|
||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified
|
||||
{
|
||||
if ($chartofaccounts > 0)
|
||||
{
|
||||
|| (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified
|
||||
if ($chartofaccounts > 0 && $permissiontoadd) {
|
||||
// Get language code for this $chartofaccounts
|
||||
$sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a';
|
||||
$sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts;
|
||||
@ -156,7 +156,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'disable') {
|
||||
if ($action == 'disable' && $permissiontoadd) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$mode = GETPOST('mode', 'int');
|
||||
$result = $accounting->accountDeactivate($id, $mode);
|
||||
@ -166,7 +166,7 @@ if (empty($reshook))
|
||||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
} elseif ($action == 'enable') {
|
||||
} elseif ($action == 'enable' && $permissiontoadd) {
|
||||
if ($accounting->fetch($id)) {
|
||||
$mode = GETPOST('mode', 'int');
|
||||
$result = $accounting->account_activate($id, $mode);
|
||||
|
||||
@ -34,7 +34,6 @@ $error = 0;
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "accountancy", "compta"));
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$id = GETPOST('id', 'int');
|
||||
@ -141,7 +140,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
} else {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql = 'SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid='.((int) $conf->global->CHARTOFACCOUNTS);
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result2 = $db->query($sql);
|
||||
@ -150,7 +149,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
// Clean code
|
||||
|
||||
// To manage zero or not at the end of the accounting account
|
||||
if ($conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||
if (isset($conf->global->ACCOUNTING_MANAGE_ZERO) && $conf->global->ACCOUNTING_MANAGE_ZERO == 1) {
|
||||
$account_number = $account_number;
|
||||
} else {
|
||||
$account_number = clean_account($account_number);
|
||||
@ -171,13 +170,12 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
$object->labelshort = GETPOST('labelshort', 'alpha');
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
if ($result > 0) {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
header("Location: " . $urltogo);
|
||||
exit();
|
||||
} else {
|
||||
$mesg = $object->error;
|
||||
setEventMessages($object->error, null, 'errors');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -255,13 +253,17 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("AccountingCategory"), $langs->transnoentitiesnoconv("AccountingAccountGroupsDesc"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1, 0, 1);
|
||||
print '</td></tr>';
|
||||
@ -281,8 +283,6 @@ if ($action == 'create') {
|
||||
$result = $object->fetch($id, $ref, 1);
|
||||
|
||||
if ($result > 0) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
$head = accounting_prepare_head($object);
|
||||
|
||||
// Edit mode
|
||||
@ -317,13 +317,17 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("AccountingCategory"), $langs->transnoentitiesnoconv("AccountingAccountGroupsDesc"));
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
||||
print '</td></tr>';
|
||||
@ -369,13 +373,17 @@ if ($action == 'create') {
|
||||
print '<tr><td>'.$langs->trans("Accountparent").'</td>';
|
||||
print '<td colspan="2">'.$accp->account_number.' - '.$accp->label.'</td></tr>';
|
||||
|
||||
// Category
|
||||
print "<tr><td>".$langs->trans("AccountingCategory")."</td><td colspan='2'>".$object->account_category_label."</td>";
|
||||
|
||||
// Chart of accounts type
|
||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||
// Group of accounting account
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("Pcgtype"), $langs->transnoentitiesnoconv("PcgtypeDesc"));
|
||||
print '</td>';
|
||||
print '<td colspan="2">'.$object->pcg_type.'</td></tr>';
|
||||
|
||||
// Custom group of accounting account
|
||||
print "<tr><td>";
|
||||
print $form->textwithpicto($langs->trans("AccountingCategory"), $langs->transnoentitiesnoconv("AccountingAccountGroupsDesc"));
|
||||
print "</td><td colspan='2'>".$object->account_category_label."</td>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -58,10 +58,33 @@ $list_binding = array(
|
||||
'ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER'
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (in_array($action, array(
|
||||
'setBANK_DISABLE_DIRECT_INPUT',
|
||||
'setACCOUNTANCY_COMBO_FOR_AUX',
|
||||
'setACCOUNTING_MANAGE_ZERO',
|
||||
'setACCOUNTING_LIST_SORT_VENTILATION_TODO',
|
||||
'setACCOUNTING_LIST_SORT_VENTILATION_DONE'))) {
|
||||
$constname = preg_replace('/^set/', '', $action);
|
||||
$constvalue = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
@ -70,7 +93,7 @@ if ($action == 'update') {
|
||||
foreach ($list as $constname)
|
||||
{
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
var_dump($constname);
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
@ -84,7 +107,7 @@ if ($action == 'update') {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if ($constname == 'ACCOUNTING_DATE_START_BINDING') {
|
||||
$constvalue = dol_mktime(12, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
|
||||
$constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int'));
|
||||
}
|
||||
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
@ -271,11 +294,11 @@ print '</tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("BANK_DISABLE_DIRECT_INPUT").'</td>';
|
||||
if (!empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disabledirectinput&value=0">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&disabledirectinput&value=1">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -284,11 +307,11 @@ print '</tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enablesubsidiarylist&value=0">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&enablesubsidiarylist&value=1">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_COMBO_FOR_AUX&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -297,11 +320,11 @@ print '</tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_MANAGE_ZERO").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&managezero&value=0">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&managezero&value=1">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_MANAGE_ZERO&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -337,11 +360,11 @@ print "</tr>\n";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&listsorttodo&value=0">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&listsorttodo&value=1">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_TODO&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -350,11 +373,11 @@ print '</tr>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&listsortdone&value=0">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&listsortdone&value=1">';
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_LIST_SORT_VENTILATION_DONE&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
@ -387,7 +410,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_SALES").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonsales&value=1">';
|
||||
@ -400,7 +423,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_PURCHASES").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonpurchases&value=1">';
|
||||
@ -413,7 +436,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS").'</td>';
|
||||
if (!empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisablebindingonexpensereports&value=1">';
|
||||
|
||||
@ -45,14 +45,14 @@ $search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
|
||||
@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
|
||||
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
|
||||
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
|
||||
|
||||
@ -985,8 +985,11 @@ if (empty($action) || $action == 'view') {
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
|
||||
|| empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
|
||||
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
print $desc;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -498,8 +498,11 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Button to write into Ledger
|
||||
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
|
||||
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
print $desc;
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
|
||||
|
||||
@ -728,9 +728,11 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Button to write into Ledger
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||
print '<br>';
|
||||
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
print $desc;
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
|
||||
@ -667,9 +667,11 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Button to write into Ledger
|
||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1') {
|
||||
print '<br>';
|
||||
print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
$desc = ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '{link}');
|
||||
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>', $desc);
|
||||
print $desc;
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||
|
||||
@ -152,7 +152,7 @@ if ($id > 0) {
|
||||
$permission = $user->rights->adherent->creer;
|
||||
$permtoedit = $user->rights->adherent->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
print "<br><br>";
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
|
||||
@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref))
|
||||
$permission = $user->rights->asset->write;
|
||||
$permtoedit = $user->rights->asset->write;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ if ($object->id)
|
||||
//$relativepathwithnofile='bom/' . dol_sanitizeFileName($object->id).'/';
|
||||
$relativepathwithnofile = 'bom/'.dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@ $nosearch = GETPOST('nosearch', 'int');
|
||||
$categstatic = new Categorie($db);
|
||||
if (is_numeric($type)) $type = Categorie::$MAP_ID_TO_CODE[$type]; // For backward compatibility
|
||||
|
||||
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('categoryindex'));
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -260,7 +260,7 @@ if ($object->id > 0)
|
||||
$modulepart = 'actions';
|
||||
$permission = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -321,15 +321,13 @@ if ($action == 'show_day')
|
||||
$next_year = $next['year'];
|
||||
$next_month = $next['month'];
|
||||
$next_day = $next['day'];
|
||||
|
||||
// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
|
||||
$firstdaytoshow = dol_mktime(0, 0, 0, $prev_month, $prev_day, $prev_year, 'tzuserrel');
|
||||
$lastdaytoshow = dol_mktime(0, 0, 0, $next_month, $next_day, $next_year, 'tzuserrel');
|
||||
}
|
||||
//print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day;
|
||||
//print 'xx'.$next_year.'-'.$next_month.'-'.$next_day;
|
||||
//print dol_print_date($firstdaytoshow,'day');
|
||||
//print dol_print_date($lastdaytoshow,'day');
|
||||
//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour');
|
||||
|
||||
/*$title = $langs->trans("DoneAndToDoActions");
|
||||
if ($status == 'done') $title = $langs->trans("DoneActions");
|
||||
@ -679,6 +677,7 @@ if ($resql)
|
||||
|
||||
$event->datep = $db->jdate($obj->datep); // datep and datef are GMT date. Example: 1970-01-01 01:00:00, jdate will return 0 if TZ of PHP server is Europe/Berlin
|
||||
$event->datef = $db->jdate($obj->datep2);
|
||||
//$event->datep_formated_gmt = dol_print_date($event->datep, 'dayhour', 'gmt');
|
||||
//var_dump($obj->datep);
|
||||
//var_dump($event->datep);
|
||||
|
||||
@ -727,14 +726,15 @@ if ($resql)
|
||||
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
|
||||
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
|
||||
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
|
||||
//var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt'));
|
||||
//var_dump(dol_print_date($event->date_start_in_calendar, 'dayhour', 'gmt')); // Hour at greenwich
|
||||
//var_dump($annee.'-'.$mois.'-'.$jour);
|
||||
|
||||
// Loop on each day covered by action to prepare an index to show on calendar
|
||||
$loop = true; $j = 0;
|
||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||
do {
|
||||
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.'<br>';
|
||||
//if ($event->id==408)
|
||||
//print 'daykey='.$daykey.' '.dol_print_date($daykey, 'dayhour', 'gmt').' '.$event->datep.' '.$event->datef.'<br>';
|
||||
|
||||
$eventarray[$daykey][] = $event;
|
||||
$j++;
|
||||
@ -751,6 +751,7 @@ if ($resql)
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
//var_dump($eventarray);
|
||||
|
||||
// Complete $eventarray with birthdates
|
||||
if ($showbirthday)
|
||||
@ -825,15 +826,12 @@ if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
||||
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
|
||||
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
|
||||
|
||||
if ($action == 'show_day')
|
||||
{
|
||||
if ($action == 'show_day') {
|
||||
// Request only leaves for the current selected day
|
||||
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";
|
||||
} elseif ($action == 'show_week')
|
||||
{
|
||||
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date without time
|
||||
} elseif ($action == 'show_week') {
|
||||
// TODO: Add filter to reduce database request
|
||||
} elseif ($action == 'show_month')
|
||||
{
|
||||
} elseif ($action == 'show_month') {
|
||||
// TODO: Add filter to reduce database request
|
||||
}
|
||||
|
||||
@ -1488,6 +1486,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
|
||||
$dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
|
||||
|
||||
//print 'show_day_events day='.$day.' month='.$month.' year='.$year.' dateint='.$dateint;
|
||||
|
||||
print "\n";
|
||||
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
@ -1538,11 +1538,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
|
||||
//var_dump($colorindexused);
|
||||
|
||||
foreach ($eventarray as $daykey => $notused)
|
||||
{
|
||||
$annee = dol_print_date($daykey, '%Y');
|
||||
$mois = dol_print_date($daykey, '%m');
|
||||
$jour = dol_print_date($daykey, '%d');
|
||||
foreach ($eventarray as $daykey => $notused) { // daykey is the 'YYYYMMDD' to show according to user
|
||||
$annee = dol_print_date($daykey, '%Y', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
|
||||
$mois = dol_print_date($daykey, '%m', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
|
||||
$jour = dol_print_date($daykey, '%d', 'gmt'); // We use gmt because we want the value represented by string 'YYYYMMDD'
|
||||
|
||||
//print 'event daykey='.$daykey.' dol_print_date(daykey)='.dol_print_date($daykey, 'dayhour', 'gmt').' jour='.$jour.' mois='.$mois.' annee='.$annee."<br>\n";
|
||||
|
||||
if ($day == $jour && $month == $mois && $year == $annee)
|
||||
{
|
||||
|
||||
@ -28,9 +28,6 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
|
||||
if (!$user->rights->societe->lire) accessforbidden();
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
@ -61,6 +58,11 @@ if (isset($user->socid) && $user->socid > 0) {
|
||||
$max = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
|
||||
$now = dol_now();
|
||||
|
||||
if (empty($user->rights->societe->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -852,6 +854,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
$orderstatic->id = $obj->commandeid;
|
||||
$orderstatic->ref = $obj->ref;
|
||||
$orderstatic->ref_client = $obj->ref_client;
|
||||
$orderstatic->statut = $obj->fk_statut;
|
||||
$orderstatic->total_ht = $obj->total_ht;
|
||||
$orderstatic->total_tva = $obj->total_tva;
|
||||
$orderstatic->total_ttc = $obj->total_ttc;
|
||||
|
||||
@ -689,6 +689,7 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
// Search Icon
|
||||
print '<td class="right">';
|
||||
print '<!-- ID mailing_cibles = '.$obj->rowid.' -->';
|
||||
if ($obj->statut == 0) // Not sent yet
|
||||
{
|
||||
if ($user->rights->mailing->creer && $allowaddtarget) {
|
||||
|
||||
@ -178,7 +178,7 @@ if ($object->id > 0)
|
||||
$permission = $user->rights->propal->creer;
|
||||
$permtoedit = $user->rights->propal->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ if ($id > 0 || !empty($ref))
|
||||
$permission = $user->rights->commande->creer;
|
||||
$permtoedit = $user->rights->commande->creer;
|
||||
$param = '&id='.$object->id.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$param = '&id='.$object->id.'&num='.urlencode($numref);
|
||||
$moreparam = '&num='.urlencode($numref); ;
|
||||
$relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/";
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$permtoedit = $user->rights->banque->modifier;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ if ($object->id)
|
||||
$modulepart = 'banque';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ if ($object->id)
|
||||
$modulepart = 'deplacement';
|
||||
$permission = $user->rights->deplacement->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -180,7 +180,7 @@ if ($id > 0 || !empty($ref))
|
||||
$permission = $user->rights->facture->creer;
|
||||
$permtoedit = $user->rights->facture->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -1016,11 +1016,6 @@ if ($resql)
|
||||
print '<td class="liste_titre right">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['f.date_closing']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['total_pa']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre right">';
|
||||
@ -1061,6 +1056,12 @@ if ($resql)
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
}
|
||||
// Date closing
|
||||
if (!empty($arrayfields['f.date_closing']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['f.note_public']['checked']))
|
||||
{
|
||||
// Note public
|
||||
|
||||
@ -160,9 +160,9 @@ if ($object->id)
|
||||
|
||||
$modulepart = 'tax';
|
||||
$permission = $user->rights->tax->charges->creer;
|
||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||
$permtoedit = $user->rights->tax->charges->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -145,9 +145,9 @@ if ($object->id)
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$permission = $user->rights->tax->charges->creer;
|
||||
$permtoedit = $user->rights->fournisseur->facture->creer;
|
||||
$permtoedit = $user->rights->tax->charges->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -75,6 +75,8 @@ if ($id > 0) $object->fetch($id);
|
||||
$upload_dir = $conf->societe->multidir_output[$object->entity].'/contact/'.dol_sanitizeFileName($object->ref);
|
||||
$modulepart = 'contact';
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contactdocument'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -44,6 +44,8 @@ if ($id > 0) $object->fetch($id);
|
||||
|
||||
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('contactcard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
|
||||
@ -192,7 +192,7 @@ if ($object->id)
|
||||
$permission = $user->rights->contrat->creer;
|
||||
$permtoedit = $user->rights->contrat->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ abstract class CommonDocGenerator
|
||||
$array_key.'_total_localtax2'=>price2num($object->total_localtax2),
|
||||
$array_key.'_total_ttc'=>price2num($object->total_ttc),
|
||||
|
||||
$array_key.'_multicurrency_code' => price2num($object->multicurrency_code),
|
||||
$array_key.'_multicurrency_code' => $object->multicurrency_code,
|
||||
$array_key.'_multicurrency_tx' => price2num($object->multicurrency_tx),
|
||||
$array_key.'_multicurrency_total_ht' => price2num($object->multicurrency_total_ht),
|
||||
$array_key.'_multicurrency_total_tva' => price2num($object->multicurrency_total_tva),
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Christophe Battarel <christophe@altairis.fr>
|
||||
@ -4295,9 +4295,17 @@ class Form
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.$input['name'].'" name="'.$input['name'].'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n";
|
||||
} elseif ($input['type'] == 'select')
|
||||
{
|
||||
$show_empty = isset($input['select_show_empty']) ? $input['select_show_empty'] : 1;
|
||||
$key_in_label = isset($input['select_key_in_label']) ? $input['select_key_in_label'] : 0;
|
||||
$value_as_key = isset($input['select_value_as_key']) ? $input['select_value_as_key'] : 0;
|
||||
$translate = isset($input['select_translate']) ? $input['select_translate'] : 0;
|
||||
$maxlen = isset($input['select_maxlen']) ? $input['select_maxlen'] : 0;
|
||||
$disabled = isset($input['select_disabled']) ? $input['select_disabled'] : 0;
|
||||
$sort = isset($input['select_sort']) ? $input['select_sort'] : '';
|
||||
|
||||
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">';
|
||||
if (!empty($input['label'])) $more .= $input['label'].'</div><div class="tagtd left">';
|
||||
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss);
|
||||
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
|
||||
$more .= '</div></div>'."\n";
|
||||
} elseif ($input['type'] == 'checkbox')
|
||||
{
|
||||
@ -6255,7 +6263,7 @@ class Form
|
||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe')
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe')
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE 1=1";
|
||||
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
||||
@ -6267,7 +6275,7 @@ class Form
|
||||
else $sql .= " AND t.fk_soc = ".$user->socid;
|
||||
}
|
||||
if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
}
|
||||
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
@ -7205,9 +7213,9 @@ class Form
|
||||
print '<input type="radio" name="idtolinkto" value='.$objp->rowid.'>';
|
||||
print '</td>';
|
||||
print '<td class="center">'.$objp->ref.'</td>';
|
||||
print '<td>'.$objp->ref_client.'</td>';
|
||||
print '<td>'.(!empty($objp->ref_client) ? $objp->ref_client : $objp->ref_supplier).'</td>';
|
||||
print '<td class="right">';
|
||||
if ($possiblelink[label] == 'LinkToContract') {
|
||||
if ($possiblelink['label'] == 'LinkToContract') {
|
||||
$form = new Form($db);
|
||||
print $form->textwithpicto('', $langs->trans("InformationOnLinkToContract")).' ';
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
// $keyforselect = name of main table
|
||||
// keyforelement = name of picto
|
||||
// $keyforaliasextra = a key to avoid conflict with extrafields of other objects
|
||||
|
||||
if (empty($keyforselect) || empty($keyforelement) || empty($keyforaliasextra))
|
||||
{
|
||||
//print $keyforselet.' - '.$keyforelement.' - '.$keyforaliasextra;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.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
|
||||
@ -257,8 +257,8 @@ function getDefaultDatesForTransfer()
|
||||
$periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER;
|
||||
isset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0;
|
||||
if ($periodbydefaultontransfer == 2) {
|
||||
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
||||
$sql = "SELECT date_start, date_end FROM ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||
$sql .= " WHERE date_start < '".$db->idate(dol_now())."' AND date_end > '".$db->idate(dol_now())."'";
|
||||
$sql .= $db->plimit(1);
|
||||
$res = $db->query($sql);
|
||||
if ($res->num_rows > 0) {
|
||||
@ -268,6 +268,9 @@ function getDefaultDatesForTransfer()
|
||||
} else {
|
||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
$year_start = dol_print_date(dol_now(), '%Y');
|
||||
if ($conf->global->SOCIETE_FISCAL_MONTH_START > dol_print_date(dol_now(), '%m')) {
|
||||
$year_start = $year_start - 1;
|
||||
}
|
||||
$year_end = $year_start + 1;
|
||||
$month_end = $month_start - 1;
|
||||
if ($month_end < 1)
|
||||
|
||||
@ -3337,7 +3337,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
|
||||
'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uparrow'=>'mail-forward', 'vcard'=>'address-card',
|
||||
'uparrow'=>'share', 'vcard'=>'address-card',
|
||||
'jabber'=>'comment-o',
|
||||
'website'=>'globe-americas'
|
||||
);
|
||||
|
||||
@ -28,7 +28,6 @@
|
||||
*/
|
||||
function payment_prepare_head(Paiement $object)
|
||||
{
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
@ -264,9 +263,9 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
} elseif ($type == 'member' || $type == 'membersubscription')
|
||||
{
|
||||
$out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '<font color="#666666">' : '');
|
||||
} elseif ($type == 'member' || $type == 'membersubscription') {
|
||||
$newtype = 'member';
|
||||
$out = $urltouse.'/public/payment/newpayment.php?source='.$newtype.'&ref='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= 'member_ref';
|
||||
if ($mode == 0) $out .= urlencode($ref);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
@ -275,8 +274,8 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$type."' + member_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$type.$ref, 2);
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYMENT_SECURITY_TOKEN."' + '".$newtype."' + member_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$newtype.$ref, 2);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,10 +104,12 @@ function dolSavePageAlias($filealias, $object, $objectpage)
|
||||
}
|
||||
// Save also alias into all language subdirectories if it is a main language
|
||||
elseif (empty($objectpage->lang) || !in_array($objectpage->lang, explode(',', $object->otherlang))) {
|
||||
if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR)) {
|
||||
if (empty($conf->global->WEBSITE_DISABLE_MAIN_LANGUAGE_INTO_LANGSUBDIR) && !empty($object->otherlang)) {
|
||||
$dirname = dirname($filealias);
|
||||
$filename = basename($filealias);
|
||||
foreach (explode(',', $object->otherlang) as $sublang) {
|
||||
// Avoid to erase main alias file if $sublang is empty string
|
||||
if (empty(trim($sublang))) continue;
|
||||
$filealiassub = $dirname.'/'.$sublang.'/'.$filename;
|
||||
|
||||
$aliascontent = '<?php'."\n";
|
||||
|
||||
@ -19,7 +19,7 @@ insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, left
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('comptabilite|accounting|asset', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->asset->enabled', 9__+MAX_llx_menu__, __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->rights->compta->resultat->lire || $user->rights->accounting->mouvements->lire || $user->rights->asset->read', '', 2, 54, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '', 8__+MAX_llx_menu__, __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('adherent', '$conf->adherent->enabled', 13__+MAX_llx_menu__, __HANDLER__, 'top', 'members', '', 0, '/adherents/index.php?mainmenu=members&leftmenu=', 'Members', -1, 'members', '$user->rights->adherent->lire', '', 2, 19, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->hrm->employee->read || $user->rights->holiday->write || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, rowid, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('hrm|holiday|deplacement|expensereport', '$conf->hrm->enabled || $conf->holiday->enabled || $conf->deplacement->enabled || $conf->expensereport->enabled', 15__+MAX_llx_menu__, __HANDLER__, 'top', 'hrm', '', 0, '/hrm/index.php?mainmenu=hrm&leftmenu=', 'HRM', -1, 'holiday', '$user->rights->user->user->lire || $user->rights->holiday->read || $user->rights->deplacement->lire || $user->rights->expensereport->lire', '', 0, 80, __ENTITY__);
|
||||
|
||||
-- Home - Dashboard
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 90__+MAX_llx_menu__, 'home', '', 1__+MAX_llx_menu__, '/index.php', 'MyDashboard', 0, '', '', '', 2, 0, __ENTITY__);
|
||||
@ -411,9 +411,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?mainmenu=members&leftmenu=cat&type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?mainmenu=members&action=create&type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
|
||||
-- HRM - Employee
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->hrm->employee->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->hrm->employee->write', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->hrm->employee->read', '', 0, 2, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->user->user->lire', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?mainmenu=hrm&action=create&employee=1', 'NewEmployee', 1, 'hrm', '$user->rights->user->user->creer', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist', 'List', 1, 'hrm', '$user->rights->user->user->lire', '', 0, 2, __ENTITY__);
|
||||
-- HRM - Holiday
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?mainmenu=hrm&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?mainmenu=hrm&action=create', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__);
|
||||
|
||||
@ -361,7 +361,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
// HRM
|
||||
$tmpentry = array(
|
||||
'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)),
|
||||
'perms'=>(!empty($user->rights->hrm->employee->read) || !empty($user->rights->holiday->write) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)),
|
||||
'perms'=>(!empty($user->rights->user->user->lire) || !empty($user->rights->holiday->read) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)),
|
||||
'module'=>'hrm|holiday|deplacement|expensereport|recruitment'
|
||||
);
|
||||
|
||||
@ -1741,9 +1741,9 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if (!empty($conf->hrm->enabled)) {
|
||||
$langs->load("hrm");
|
||||
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm');
|
||||
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write);
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read);
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->user->user->lire, '', $mainmenu, 'hrm');
|
||||
$newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->user->user->creer);
|
||||
$newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->user->user->lire);
|
||||
}
|
||||
|
||||
// Leave/Holiday/Vacation module
|
||||
|
||||
@ -290,9 +290,12 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -338,9 +338,12 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -335,9 +335,12 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -355,9 +355,12 @@ class pdf_sponge extends ModelePDFFactures
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -285,15 +285,15 @@ class modAccounting extends DolibarrModules
|
||||
//'b.doc_type'=>'Doctype',
|
||||
'b.doc_ref'=>'Piece',
|
||||
'b.code_journal'=>'Codejournal',
|
||||
//'b.journal_label'=>'JournalLabel',
|
||||
'b.journal_label'=>'JournalLabel',
|
||||
'b.numero_compte'=>'AccountAccounting',
|
||||
//'b.label_compte'=>'LabelAccount',
|
||||
'b.label_compte'=>'LabelAccount',
|
||||
'b.subledger_account'=>'SubledgerAccount',
|
||||
'b.subledger_label'=>'SubledgerAccountLabel',
|
||||
'b.label_operation'=>'LabelOperation',
|
||||
'b.debit'=>"Debit",
|
||||
'b.credit'=>"Credit",
|
||||
'b.sens'=>'Direction' // This field is still used by accounting export. We can remove it once it has been replace into accountancyexport.class.php by a detection using ->debit and ->credit
|
||||
'b.sens'=>'Direction' // This field is still used by accounting export. We can remove it once it has been replaced into accountancyexport.class.php by a detection using ->debit and ->credit
|
||||
);
|
||||
$this->import_fieldshidden_array[$r] = array('b.doc_type'=>'const-import_from_external', 'b.fk_doc'=>'const-0', 'b.fk_docdet'=>'const-0', 'b.fk_user_author'=>'user->id', 'b.date_creation'=>'const-'.dol_print_date(dol_now(), 'standard')); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
|
||||
$this->import_regex_array[$r] = array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
|
||||
@ -303,9 +303,9 @@ class modAccounting extends DolibarrModules
|
||||
//'b.doc_type'=>'import',
|
||||
'b.doc_ref'=>'My document ABC',
|
||||
'b.code_journal'=>"VTE",
|
||||
//'b.journal_label'=>"Sale journal",
|
||||
'b.journal_label'=>"Sale journal",
|
||||
'b.numero_compte'=>"707",
|
||||
//'b.label_compte'=>'Product account 707',
|
||||
'b.label_compte'=>'Product account 707',
|
||||
'b.subledger_account'=>'',
|
||||
'b.subledger_label'=>'',
|
||||
'b.label_operation'=>"Sale of ABC",
|
||||
|
||||
@ -413,7 +413,7 @@ class modAgenda extends DolibarrModules
|
||||
'langs' => 'agenda',
|
||||
'position' => 170,
|
||||
'perms' => '$user->rights->agenda->allactions->read',
|
||||
'enabled' => '$conf->categorie->enabled&&$conf->categorie->enabled',
|
||||
'enabled' => '$conf->categorie->enabled',
|
||||
'target' => '',
|
||||
'user' => 2
|
||||
);
|
||||
@ -454,8 +454,12 @@ class modAgenda extends DolibarrModules
|
||||
'p.ref' => 'project',
|
||||
);
|
||||
|
||||
$keyforselect = 'actioncomm'; $keyforelement = 'action'; $keyforaliasextra = 'extra';
|
||||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'actioncomm as ac';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_extrafields as extra ON ac.id = extra.fk_object';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id';
|
||||
if (!empty($user) && empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_resources acr on ac.id = acr.fk_actioncomm';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid';
|
||||
|
||||
@ -89,6 +89,7 @@ class modHRM extends DolibarrModules
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
$r = 0;
|
||||
|
||||
/*
|
||||
$this->rights[$r][0] = 4001;
|
||||
$this->rights[$r][1] = 'See employees';
|
||||
$this->rights[$r][3] = 0;
|
||||
@ -116,7 +117,7 @@ class modHRM extends DolibarrModules
|
||||
$this->rights[$r][4] = 'employee';
|
||||
$this->rights[$r][5] = 'export';
|
||||
$r++;
|
||||
|
||||
*/
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
@ -335,9 +335,12 @@ class pdf_azur extends ModelePDFPropales
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -339,9 +339,12 @@ class pdf_cyan extends ModelePDFPropales
|
||||
}
|
||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||
// Set path to the background PDF File
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||
{
|
||||
$pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) {
|
||||
$logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
}
|
||||
$pagecount = $pdf->setSourceFile($logodir.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
|
||||
$tplidx = $pdf->importPage(1);
|
||||
}
|
||||
|
||||
|
||||
@ -241,7 +241,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
|
||||
if (!empty($conf->global->MAIN_DOC_USE_OBJECT_THIRDPARTY_NAME))
|
||||
{
|
||||
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp;
|
||||
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp;
|
||||
$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
|
||||
}
|
||||
if (!empty($conf->global->MAIN_DOC_USE_TIMING))
|
||||
{
|
||||
|
||||
@ -182,10 +182,10 @@ if ($object->id)
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$modulepart = 'don';
|
||||
$permission = $user->rights->don->lire;
|
||||
$permission = $user->rights->don->creer;
|
||||
$permtoedit = $user->rights->don->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$permission = $user->rights->expedition->creer;
|
||||
$permtoedit = $user->rights->expedition->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010 Cyrille de Lambert <info@auguria.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/expensereport/ajax/ajaxprojet.php
|
||||
* \ingroup expensereport
|
||||
* \brief File to return Ajax response on third parties request
|
||||
*/
|
||||
|
||||
if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); // Disables token renewal
|
||||
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
|
||||
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
|
||||
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
|
||||
if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1');
|
||||
if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1');
|
||||
|
||||
$res = 0;
|
||||
require '../../main.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
// Ajout directives pour resoudre bug IE
|
||||
//header('Cache-Control: Public, must-revalidate');
|
||||
//header('Pragma: public');
|
||||
|
||||
//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
|
||||
top_httphead();
|
||||
|
||||
//print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
|
||||
|
||||
dol_syslog(join(',', $_GET));
|
||||
|
||||
|
||||
// Generation liste des projets
|
||||
if (GETPOST('fk_projet') != '')
|
||||
{
|
||||
$return_arr = array();
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, s.nom";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
|
||||
if (!empty($_GET["fk_projet"])) $sql .= " WHERE p.ref LIKE '%".$db->escape($_GET["fk_projet"])."%' OR p.title LIKE '%".$db->escape($_GET["fk_projet"])."%' OR s.nom LIKE '%".$db->escape($_GET["fk_projet"])."%'"; // Add other filters
|
||||
$sql .= " ORDER BY p.ref ASC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($row = $db->fetch_array($resql))
|
||||
{
|
||||
$label = $row['ref'].' - '.$row['title'];
|
||||
$row_array['label'] = $label;
|
||||
$row_array['value'] = $label;
|
||||
$row_array['key'] = $row['rowid'];
|
||||
|
||||
array_push($return_arr, $row_array);
|
||||
}
|
||||
|
||||
echo json_encode($return_arr);
|
||||
} else {
|
||||
echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error'));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter'));
|
||||
}
|
||||
@ -149,7 +149,7 @@ if ($object->id)
|
||||
$permission = $user->rights->expensereport->creer;
|
||||
$permtoedit = $user->rights->expensereport->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ if ($object->id)
|
||||
$permission = $user->rights->ficheinter->creer;
|
||||
$permtoedit = $user->rights->ficheinter->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -223,6 +223,10 @@ if (!empty($conf->contrat->enabled)) {
|
||||
}
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (f.rowid = ef.fk_object)";
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
if (!$user->rights->societe->client->voir && empty($socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql .= " WHERE f.entity IN (".getEntity('intervention').")";
|
||||
@ -259,6 +263,10 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
// Add GroupBy from hooks
|
||||
$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
|
||||
@ -72,7 +72,7 @@ class SupplierOrders extends DolibarrApi
|
||||
throw new RestException(404, 'Supplier order not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ class SupplierOrders extends DolibarrApi
|
||||
throw new RestException(404, 'Supplier order not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
@ -270,7 +270,7 @@ class SupplierOrders extends DolibarrApi
|
||||
throw new RestException(404, 'Supplier order not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ class SupplierOrders extends DolibarrApi
|
||||
throw new RestException(404, 'Order not found');
|
||||
}
|
||||
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, '', 'commande')) {
|
||||
if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->order->id, 'commande_fournisseur', 'commande')) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
|
||||
@ -2621,14 +2621,11 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->line->desc = $desc;
|
||||
|
||||
// redefine quantity according to packaging
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING))
|
||||
{
|
||||
if ($qty < $this->line->packaging)
|
||||
{
|
||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||
if ($qty < $this->line->packaging) {
|
||||
$qty = $this->line->packaging;
|
||||
} else {
|
||||
if (($qty % $this->line->packaging) > 0)
|
||||
{
|
||||
if (! empty($this->line->packaging) && ($qty % $this->line->packaging) > 0) {
|
||||
$coeff = intval($qty / $this->line->packaging) + 1;
|
||||
$qty = $this->line->packaging * $coeff;
|
||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||
|
||||
@ -83,7 +83,7 @@ class PaiementFourn extends Paiement
|
||||
* Load payment object
|
||||
*
|
||||
* @param int $id Id if payment to get
|
||||
* @param string $ref Ref of payment to get (currently ref = id but this may change in future)
|
||||
* @param string $ref Ref of payment to get
|
||||
* @param int $fk_bank Id of bank line associated to payment
|
||||
* @return int <0 if KO, -2 if not found, >0 if OK
|
||||
*/
|
||||
@ -101,7 +101,7 @@ class PaiementFourn extends Paiement
|
||||
if ($id > 0)
|
||||
$sql .= ' AND p.rowid = '.$id;
|
||||
elseif ($ref)
|
||||
$sql .= ' AND p.rowid = '.$ref;
|
||||
$sql .= ' AND p.ref = '.$ref;
|
||||
elseif ($fk_bank)
|
||||
$sql .= ' AND p.fk_bank = '.$fk_bank;
|
||||
//print $sql;
|
||||
|
||||
@ -176,7 +176,7 @@ if ($object->id > 0)
|
||||
$permission = $user->rights->fournisseur->commande->creer;
|
||||
$permtoedit = $user->rights->fournisseur->commande->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
|
||||
@ -419,6 +419,10 @@ if ($search_user > 0)
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
|
||||
$sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql .= ' WHERE f.fk_soc = s.rowid';
|
||||
$sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')';
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
@ -512,10 +516,19 @@ if (!$search_all)
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key : '');
|
||||
}
|
||||
}
|
||||
// Add GroupBy from hooks
|
||||
$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
}
|
||||
|
||||
// Add HAVING from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : '';
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
@ -594,6 +607,10 @@ if ($resql)
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2021 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
|
||||
@ -171,7 +172,7 @@ if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
if ($search_payment_type != '') $sql .= " AND c.code='".$db->escape($search_payment_type)."'";
|
||||
if ($search_cheque_num != '') $sql .= natural_search('p.num_paiement', $search_cheque_num);
|
||||
if ($search_amount) $sql .= natural_search('p.amount', $search_amount, 1);
|
||||
if ($search_bank_account > 0) $sql .= ' AND b.fk_account='.$search_bank_account."'";
|
||||
if ($search_bank_account > 0) $sql .= ' AND b.fk_account='.((int) $search_bank_account);
|
||||
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
|
||||
|
||||
@ -300,7 +300,7 @@ if ($object->id)
|
||||
$permission = $user->rights->holiday->write;
|
||||
$permtoedit = $user->rights->holiday->write;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -655,11 +655,11 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1062, 'PCMN-BASE', 'FINAN', '578', '1060', 'Caisses - timbres ( 0 - fiscaux ; 1 - postaux)', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1063, 'PCMN-BASE', 'FINAN', '58', '1355', 'Virements internes', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1064, 'PCMN-BASE', 'EXPENSE', '60', '1356', 'Approvisionnements et marchandises', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '600', '1064', 'Achats de matières premières', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '601', '1064', 'Achats de fournitures', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'PCMN-BASE', 'EXPENSE', 'SERVICE', '602', '1064', 'Achats de services, travaux et études', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1065, 'PCMN-BASE', 'EXPENSE', '600', '1064', 'Achats de matières premières', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1066, 'PCMN-BASE', 'EXPENSE', '601', '1064', 'Achats de fournitures', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1067, 'PCMN-BASE', 'EXPENSE', '602', '1064', 'Achats de services, travaux et études', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1068, 'PCMN-BASE', 'EXPENSE', '603', '1064', 'Sous-traitances générales', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'PCMN-BASE', 'EXPENSE', 'PRODUCT', '604', '1064', 'Achats de marchandises', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1069, 'PCMN-BASE', 'EXPENSE', '604', '1064', 'Achats de marchandises', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1070, 'PCMN-BASE', 'EXPENSE', '605', '1064', 'Achats d''immeubles destinés à la revente', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1071, 'PCMN-BASE', 'EXPENSE', '608', '1064', 'Remises , ristournes et rabais obtenus sur achats', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1072, 'PCMN-BASE', 'EXPENSE', '609', '1064', 'Variations de stocks', 1);
|
||||
@ -849,24 +849,24 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1256, 'PCMN-BASE', 'EXPENSE', '695', '1250', 'Administrateurs ou gérants', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1257, 'PCMN-BASE', 'EXPENSE', '696', '1250', 'Autres allocataires', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1258, 'PCMN-BASE', 'INCOME', '70', '1357', 'Chiffre d''affaires', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1260, 'PCMN-BASE', 'INCOME', 'PRODUCT', '700', '1258', 'Ventes de marchandises', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1261, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7000', '1260', 'Ventes en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1262, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1263, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7002', '1260', 'Ventes à l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1264, 'PCMN-BASE', 'INCOME', 'PRODUCT', '701', '1258', 'Ventes de produits finis', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1265, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7010', '1264', 'Ventes en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1266, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1267, 'PCMN-BASE', 'INCOME', 'PRODUCT', '7012', '1264', 'Ventes à l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1260, 'PCMN-BASE', 'INCOME', '700', '1258', 'Ventes de marchandises', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1261, 'PCMN-BASE', 'INCOME', '7000', '1260', 'Ventes en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1262, 'PCMN-BASE', 'INCOME', '7001', '1260', 'Ventes dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1263, 'PCMN-BASE', 'INCOME', '7002', '1260', 'Ventes à l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1264, 'PCMN-BASE', 'INCOME', '701', '1258', 'Ventes de produits finis', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1265, 'PCMN-BASE', 'INCOME', '7010', '1264', 'Ventes en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1266, 'PCMN-BASE', 'INCOME', '7011', '1264', 'Ventes dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1267, 'PCMN-BASE', 'INCOME', '7012', '1264', 'Ventes à l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1268, 'PCMN-BASE', 'INCOME', '702', '1258', 'Ventes de déchets et rebuts', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1269, 'PCMN-BASE', 'INCOME', '7020', '1268', 'Ventes en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1270, 'PCMN-BASE', 'INCOME', '7021', '1268', 'Ventes dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1271, 'PCMN-BASE', 'INCOME', '7022', '1268', 'Ventes à l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1272, 'PCMN-BASE', 'INCOME', '703', '1258', 'Ventes d''emballages récupérables', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1273, 'PCMN-BASE', 'INCOME', '704', '1258', 'Facturations des travaux en cours (associations momentanées)', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1274, 'PCMN-BASE', 'INCOME', 'SERVICE', '705', '1258', 'Prestations de services', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1275, 'PCMN-BASE', 'INCOME', 'SERVICE', '7050', '1274', 'Prestations de services en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1276, 'PCMN-BASE', 'INCOME', 'SERVICE', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1277, 'PCMN-BASE', 'INCOME', 'SERVICE', '7052', '1274', 'Prestations de services en vue de l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1274, 'PCMN-BASE', 'INCOME', '705', '1258', 'Prestations de services', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1275, 'PCMN-BASE', 'INCOME', '7050', '1274', 'Prestations de services en Belgique', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1276, 'PCMN-BASE', 'INCOME', '7051', '1274', 'Prestations de services dans les pays membres de la C.E.E.', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1277, 'PCMN-BASE', 'INCOME', '7052', '1274', 'Prestations de services en vue de l''exportation', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1278, 'PCMN-BASE', 'INCOME', '706', '1258', 'Pénalités et dédits obtenus par l''entreprise', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1279, 'PCMN-BASE', 'INCOME', '708', '1258', 'Remises, ristournes et rabais accordés', 1);
|
||||
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 1280, 'PCMN-BASE', 'INCOME', '7080', '1279', 'Sur ventes de marchandises', 1);
|
||||
|
||||
@ -207,7 +207,7 @@ Codejournal=Journal
|
||||
JournalLabel=Journal label
|
||||
NumPiece=Piece number
|
||||
TransactionNumShort=Num. transaction
|
||||
AccountingCategory=Personalized groups
|
||||
AccountingCategory=Custom group
|
||||
GroupByAccountAccounting=Group by general ledger account
|
||||
GroupBySubAccountAccounting=Group by subledger account
|
||||
AccountingAccountGroupsDesc=You can define here some groups of accounting account. They will be used for personalized accounting reports.
|
||||
|
||||
@ -157,7 +157,7 @@ if ($object->id)
|
||||
$permission = $user->rights->loan->write;
|
||||
$permtoedit = $user->rights->loan->write;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ if ($object->id)
|
||||
//$relativepathwithnofile='myobject/' . dol_sanitizeFileName($object->id).'/';
|
||||
$relativepathwithnofile = 'myobject/'.dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ if ($object->id)
|
||||
//$relativepathwithnofile='mo/' . dol_sanitizeFileName($object->id).'/';
|
||||
$relativepathwithnofile = 'mo/'.dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ if ($object->id)
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
||||
|
||||
// Merge propal PDF document PDF files
|
||||
|
||||
@ -97,7 +97,7 @@ if (empty($reshook))
|
||||
$object->fk_parent = (int) GETPOST("fk_parent", "int");
|
||||
$object->label = (string) GETPOST("libelle", "alpha");
|
||||
$object->description = (string) GETPOST("desc", "alpha");
|
||||
$object->statut = GETPOST("statut");
|
||||
$object->statut = GETPOST("statut", "int");
|
||||
$object->lieu = (string) GETPOST("lieu", "alpha");
|
||||
$object->address = (string) GETPOST("address", "alpha");
|
||||
$object->zip = (string) GETPOST("zipcode", "alpha");
|
||||
@ -160,7 +160,7 @@ if (empty($reshook))
|
||||
{
|
||||
if ($object->fetch($id))
|
||||
{
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->fk_parent = GETPOST("fk_parent");
|
||||
$object->description = GETPOST("desc");
|
||||
$object->statut = GETPOST("statut");
|
||||
@ -169,8 +169,8 @@ if (empty($reshook))
|
||||
$object->zip = GETPOST("zipcode");
|
||||
$object->town = GETPOST("town");
|
||||
$object->country_id = GETPOST("country_id");
|
||||
$object->phone = GETPOST("phone");
|
||||
$object->fax = GETPOST("fax");
|
||||
$object->phone = GETPOST("phone");
|
||||
$object->fax = GETPOST("fax");
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
|
||||
@ -153,7 +153,7 @@ if ($object->id)
|
||||
|
||||
$permission = ($user->rights->produit->creer);
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -612,7 +612,18 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
$array = array();
|
||||
if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject");
|
||||
if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject");
|
||||
print $form->selectarray('public', $array, GETPOST('public') ?GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTISSET('public') ? GETPOST('public') : $object->public).'">';
|
||||
|
||||
if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) {
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
@ -886,11 +897,21 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
$array = array();
|
||||
if (empty($conf->global->PROJECT_DISABLE_PRIVATE_PROJECT)) $array[0] = $langs->trans("PrivateProject");
|
||||
if (empty($conf->global->PROJECT_DISABLE_PUBLIC_PROJECT)) $array[1] = $langs->trans("SharedProject");
|
||||
print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" id="public" name="public" value="'.$object->public.'">';
|
||||
|
||||
if ($object->public == 0) {
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
{
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
$classfortr = ($object->usage_opportunity ? '' : ' hideobject');
|
||||
// Opportunity status
|
||||
print '<tr class="classuseopportunity'.$classfortr.'"><td>'.$langs->trans("OpportunityStatus").'</td>';
|
||||
|
||||
@ -156,7 +156,7 @@ if ($object->id > 0)
|
||||
$modulepart = 'project';
|
||||
$permission = ($userWrite > 0);
|
||||
$permtoedit = ($userWrite > 0);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
dol_print_error('', 'NoRecordFound');
|
||||
}
|
||||
|
||||
@ -314,7 +314,7 @@ if ($object->id > 0)
|
||||
$permission = $user->rights->projet->creer;
|
||||
$permtoedit = $user->rights->projet->creer;
|
||||
$relativepathwithnofile = dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
|
||||
@ -1336,7 +1336,7 @@ if ($source == 'contractline')
|
||||
}
|
||||
|
||||
// Payment on member subscription
|
||||
if ($source == 'membersubscription')
|
||||
if ($source == 'member' || $source == 'membersubscription')
|
||||
{
|
||||
$found = true;
|
||||
$langs->load("members");
|
||||
|
||||
@ -51,7 +51,7 @@ $langs->loadLangs(array("companies", "other", "ticket"));
|
||||
// Get parameters
|
||||
$track_id = GETPOST('track_id', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$email = GETPOST('email', 'alpha');
|
||||
$email = strtolower(GETPOST('email', 'alpha'));
|
||||
|
||||
if (GETPOST('btn_view_ticket_list')) {
|
||||
unset($_SESSION['track_id_customer']);
|
||||
@ -61,7 +61,7 @@ if (isset($_SESSION['track_id_customer'])) {
|
||||
$track_id = $_SESSION['track_id_customer'];
|
||||
}
|
||||
if (isset($_SESSION['email_customer'])) {
|
||||
$email = $_SESSION['email_customer'];
|
||||
$email = strtolower($_SESSION['email_customer']);
|
||||
}
|
||||
|
||||
$object = new Ticket($db);
|
||||
@ -101,7 +101,7 @@ if ($action == "view_ticketlist") {
|
||||
// vérifie si l'adresse email est bien dans les contacts du ticket
|
||||
$contacts = $object->liste_contact(-1, 'external');
|
||||
foreach ($contacts as $contact) {
|
||||
if ($contact['email'] == $email) {
|
||||
if (strtolower($contact['email']) == $email) {
|
||||
$display_ticket_list = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
$_SESSION['track_id_customer'] = $track_id;
|
||||
@ -112,7 +112,7 @@ if ($action == "view_ticketlist") {
|
||||
}
|
||||
if ($object->fk_soc > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
if ($email == $object->thirdparty->email) {
|
||||
if ($email == strtolower($object->thirdparty->email)) {
|
||||
$display_ticket_list = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
$_SESSION['track_id_customer'] = $track_id;
|
||||
@ -121,14 +121,14 @@ if ($action == "view_ticketlist") {
|
||||
if ($object->fk_user_create > 0) {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($object->fk_user_create);
|
||||
if ($email == $tmpuser->email) {
|
||||
if ($email == strtolower($tmpuser->email)) {
|
||||
$display_ticket_list = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
$_SESSION['track_id_customer'] = $track_id;
|
||||
}
|
||||
}
|
||||
|
||||
$emailorigin = CMailFile::getValidAddress($object->origin_email, 2);
|
||||
$emailorigin = strtolower(CMailFile::getValidAddress($object->origin_email, 2));
|
||||
if ($email == $emailorigin) {
|
||||
$display_ticket_list = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
|
||||
@ -53,13 +53,13 @@ $langs->loadLangs(array("companies", "other", "ticket"));
|
||||
$track_id = GETPOST('track_id', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$email = GETPOST('email', 'alpha');
|
||||
$email = strtolower(GETPOST('email', 'alpha'));
|
||||
|
||||
if (GETPOST('btn_view_ticket')) {
|
||||
unset($_SESSION['email_customer']);
|
||||
}
|
||||
if (isset($_SESSION['email_customer'])) {
|
||||
$email = $_SESSION['email_customer'];
|
||||
$email = strtolower($_SESSION['email_customer']);
|
||||
}
|
||||
|
||||
$object = new ActionsTicket($db);
|
||||
@ -103,7 +103,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
$ret = $object->fetch('', '', $track_id);
|
||||
if ($ret && $object->dao->id > 0) {
|
||||
// Check if emails provided is the one of author
|
||||
$emailofticket = CMailFile::getValidAddress($object->dao->origin_email, 2);
|
||||
$emailofticket = strtolower(CMailFile::getValidAddress($object->dao->origin_email, 2));
|
||||
if ($emailofticket == $email)
|
||||
{
|
||||
$display_ticket = true;
|
||||
@ -113,7 +113,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
else {
|
||||
$contacts = $object->dao->liste_contact(-1, 'external');
|
||||
foreach ($contacts as $contact) {
|
||||
if ($contact['email'] == $email) {
|
||||
if (strtolower($contact['email']) == $email) {
|
||||
$display_ticket = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
break;
|
||||
@ -135,7 +135,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
{
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($object->dao->fk_user_create);
|
||||
if ($email == $tmpuser->email) {
|
||||
if ($email == strtolower($tmpuser->email)) {
|
||||
$display_ticket = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
}
|
||||
@ -145,7 +145,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
{
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($object->dao->fk_user_assign);
|
||||
if ($email == $tmpuser->email) {
|
||||
if ($email == strtolower($tmpuser->email)) {
|
||||
$display_ticket = true;
|
||||
$_SESSION['email_customer'] = $email;
|
||||
}
|
||||
|
||||
@ -237,8 +237,6 @@ if (empty($reshook))
|
||||
$objectsrc = new $classname($db);
|
||||
$objectsrc->fetch($object->origin_id);
|
||||
|
||||
|
||||
|
||||
$object->socid = $objectsrc->socid;
|
||||
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
|
||||
$object->model_pdf = GETPOST('model');
|
||||
@ -280,10 +278,8 @@ if (empty($reshook))
|
||||
$stockLocation = "ent1".$i."_0";
|
||||
$qty = "qtyl".$i;
|
||||
|
||||
|
||||
|
||||
//var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit;
|
||||
//reception line for product with no batch management and no multiple stock location
|
||||
//var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit;
|
||||
//reception line for product with no batch management and no multiple stock location
|
||||
if (GETPOST($qty, 'int') > 0)
|
||||
$totalqty += GETPOST($qty, 'int');
|
||||
|
||||
@ -318,9 +314,15 @@ if (empty($reshook))
|
||||
|
||||
$entrepot_id = is_numeric(GETPOST($ent, 'int')) ? GETPOST($ent, 'int') : GETPOST('entrepot_id', 'int');
|
||||
|
||||
if (!empty($lineToTest)) {
|
||||
$fk_product = $lineToTest->fk_product;
|
||||
} else {
|
||||
$fk_product = $linesrc->fk_product;
|
||||
}
|
||||
|
||||
if ($entrepot_id < 0)
|
||||
$entrepot_id = '';
|
||||
if (!($linesrc->fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
if (!($fk_product > 0) && empty($conf->global->STOCK_SUPPORTS_SERVICES))
|
||||
$entrepot_id = 0;
|
||||
$eatby = GETPOST($eatby, 'alpha');
|
||||
$sellby = GETPOST($sellby, 'alpha');
|
||||
|
||||
@ -195,7 +195,7 @@ if ($object->id)
|
||||
|
||||
$relativepathwithnofile = 'recruitmentcandidature/'.dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ if ($object->id)
|
||||
//$relativepathwithnofile='recruitmentjobposition/' . dol_sanitizeFileName($object->id).'/';
|
||||
$relativepathwithnofile = 'recruitmentjobposition/'.dol_sanitizeFileName($object->ref).'/';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ if ($object->id > 0)
|
||||
$modulepart = 'dolresource';
|
||||
$permission = $user->rights->resource->write;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ if ($object->id)
|
||||
$modulepart = 'salaries';
|
||||
$permission = $user->rights->salaries->write;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ if ($object->id)
|
||||
$permission = $user->rights->societe->creer;
|
||||
$permtoedit = $user->rights->societe->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 0);
|
||||
}
|
||||
|
||||
@ -676,7 +676,7 @@ if (empty($type) || $type == 'c' || $type == 'p')
|
||||
}
|
||||
if (empty($type) || $type == 'f')
|
||||
{
|
||||
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire)
|
||||
if (!empty($conf->fournisseur->enabled) && !empty($conf->categorie->enabled) && $user->rights->categorie->lire)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
|
||||
@ -165,7 +165,7 @@ if ($object->id > 0)
|
||||
$permission = $user->rights->supplier_proposal->creer;
|
||||
$permtoedit = $user->rights->supplier_proposal->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
print $langs->trans("ErrorUnknown");
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ if ($object->id)
|
||||
$permtoedit = $user->rights->ticket->write;
|
||||
$param = '&id='.$object->id;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -621,8 +621,7 @@ class Users extends DolibarrApi
|
||||
unset($object->facebook);
|
||||
unset($object->linkedin);
|
||||
|
||||
$canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read))
|
||||
|| (!empty($conf->hrm->enabled) && !empty(DolibarrApiAccess::$user->rights->hrm->employee->read)));
|
||||
$canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled)));
|
||||
|
||||
if (!$canreadsalary) {
|
||||
unset($object->salary);
|
||||
|
||||
@ -170,7 +170,7 @@ if ($object->id)
|
||||
$permission = $user->rights->user->user->creer;
|
||||
$permtoedit = $user->rights->user->user->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -184,6 +184,11 @@ class Website extends CommonObject
|
||||
$tmparray = explode(',', $this->otherlang);
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $key => $val) {
|
||||
// It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,'
|
||||
if (empty(trim($val))) {
|
||||
unset($tmparray[$key]);
|
||||
continue;
|
||||
}
|
||||
$tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en
|
||||
}
|
||||
$this->otherlang = join(',', $tmparray);
|
||||
@ -494,6 +499,11 @@ class Website extends CommonObject
|
||||
$tmparray = explode(',', $this->otherlang);
|
||||
if (is_array($tmparray)) {
|
||||
foreach ($tmparray as $key => $val) {
|
||||
// It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,'
|
||||
if (empty(trim($val))) {
|
||||
unset($tmparray[$key]);
|
||||
continue;
|
||||
}
|
||||
$tmparray[$key] = preg_replace('/[_-].*$/', '', trim($val)); // en_US or en-US -> en
|
||||
}
|
||||
$this->otherlang = join(',', $tmparray);
|
||||
|
||||
@ -551,6 +551,8 @@ if ($action == 'addsite')
|
||||
{
|
||||
$arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml'));
|
||||
foreach ($arrayotherlang as $key => $val) {
|
||||
// It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,'
|
||||
if (empty(trim($val))) continue;
|
||||
$arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only
|
||||
}
|
||||
|
||||
@ -1327,6 +1329,8 @@ if ($action == 'updatecss')
|
||||
{
|
||||
$arrayotherlang = explode(',', GETPOST('WEBSITE_OTHERLANG', 'alphanohtml'));
|
||||
foreach ($arrayotherlang as $key => $val) {
|
||||
// It possible we have empty val here if postparam WEBSITE_OTHERLANG is empty or set like this : 'en,,sv' or 'en,sv,'
|
||||
if (empty(trim($val))) continue;
|
||||
$arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only
|
||||
}
|
||||
|
||||
@ -1768,6 +1772,10 @@ if ($action == 'updatemeta')
|
||||
$filename = basename($fileoldalias);
|
||||
$sublangs = explode(',', $object->otherlang);
|
||||
foreach ($sublangs as $sublang) {
|
||||
// Under certain conditions $sublang can be an empty string
|
||||
// ($object->otherlang with empty string or with string like this 'en,,sv')
|
||||
// if is the case we try to re-delete the main alias file. Avoid it.
|
||||
if (empty(trim($sublang))) continue;
|
||||
$fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename;
|
||||
dol_delete_file($fileoldaliassub);
|
||||
}
|
||||
@ -1790,6 +1798,10 @@ if ($action == 'updatemeta')
|
||||
$filename = basename($pathofwebsite.'/'.trim($tmpaliasalt).'.php');
|
||||
$sublangs = explode(',', $object->otherlang);
|
||||
foreach ($sublangs as $sublang) {
|
||||
// Under certain conditions $ sublang can be an empty string
|
||||
// ($object->otherlang with empty string or with string like this 'en,,sv')
|
||||
// if is the case we try to re-delete the main alias file. Avoid it.
|
||||
if (empty(trim($sublang))) continue;
|
||||
$fileoldaliassub = $dirname.'/'.$sublang.'/'.$filename;
|
||||
dol_delete_file($fileoldaliassub);
|
||||
}
|
||||
@ -2710,6 +2722,7 @@ if (!GETPOST('hide_websitemenu'))
|
||||
$onlylang[$website->lang] = $website->lang.' ('.$langs->trans("Default").')';
|
||||
}
|
||||
foreach (explode(',', $website->otherlang) as $langkey) {
|
||||
if (empty(trim($langkey))) continue;
|
||||
$onlylang[$langkey] = $langkey;
|
||||
}
|
||||
$textifempty = $langs->trans("Default");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user