Move default value for user expense report on tab expense report
This commit is contained in:
parent
6165bcdbd0
commit
5c189449e1
@ -438,8 +438,11 @@ class Form
|
||||
|
||||
$s='';$textfordialog='';
|
||||
|
||||
$htmltext=str_replace('"',""",$htmltext);
|
||||
if ($tooltiptrigger != '')
|
||||
if ($tooltiptrigger == '')
|
||||
{
|
||||
$htmltext=str_replace('"',""",$htmltext);
|
||||
}
|
||||
else
|
||||
{
|
||||
$classfortooltip='classfortooltiponclick';
|
||||
$textfordialog.='<div style="display: none;" id="idfortooltiponclick_'.$tooltiptrigger.'" class="classfortooltiponclicktext">'.$htmltext.'</div>';
|
||||
@ -6448,7 +6451,7 @@ class Form
|
||||
*/
|
||||
function selectExpenseCategories($selected='', $htmlname='fk_c_exp_tax_cat', $useempty=0, $excludeid=array(), $target='', $default_selected=0, $params=array())
|
||||
{
|
||||
global $db,$conf,$langs;
|
||||
global $db, $conf, $langs, $user;
|
||||
|
||||
$sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1';
|
||||
$sql.= ' AND entity IN (0,'.getEntity('').')';
|
||||
@ -6459,13 +6462,14 @@ class Form
|
||||
if ($resql)
|
||||
{
|
||||
$out = '<select name="'.$htmlname.'" class="'.$htmlname.' flat minwidth75imp">';
|
||||
if ($useempty) $out.= '<option value="0"></option>';
|
||||
if ($useempty) $out.= '<option value="0"> </option>';
|
||||
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$out.= '<option '.($selected == $obj->rowid ? 'selected="selected"' : '').' value="'.$obj->rowid.'">'.$langs->trans($obj->label).'</option>';
|
||||
}
|
||||
$out.= '</select>';
|
||||
if (! empty($htmlname) && $user->admin) $out .= ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
|
||||
if (!empty($target))
|
||||
{
|
||||
|
||||
@ -32,6 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
|
||||
|
||||
$langs->load("companies");
|
||||
$langs->load("users");
|
||||
@ -126,6 +127,10 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
}
|
||||
}
|
||||
|
||||
$canedituser=(! empty($user->admin) || $user->rights->user->user->creer);
|
||||
|
||||
$object = new ExpenseReport($db);
|
||||
$objectuser = new User($db);
|
||||
|
||||
|
||||
/*
|
||||
@ -172,6 +177,51 @@ if (empty($reshook))
|
||||
$permtodelete = $user->rights->expensereport->supprimer;
|
||||
$uploaddir = $conf->expensereport->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if ($action == 'update' && ! $cancel)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if ($canedituser) // Case we can edit all field
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
$objectuser->fetch($id);
|
||||
|
||||
$objectuser->oldcopy = clone $objectuser;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$objectuser->default_range = GETPOST('default_range');
|
||||
$objectuser->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat');
|
||||
|
||||
if (!$error) {
|
||||
$ret = $objectuser->update($user);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorLoginAlreadyExists", $objectuser->login), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($objectuser->error, $objectuser->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && !count($objectuser->errors)) {
|
||||
setEventMessages($langs->trans("UserModified"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -338,7 +388,7 @@ if ($resql)
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="action" value="'.($action=='edit'?'update':'list').'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
@ -355,9 +405,43 @@ if ($resql)
|
||||
|
||||
dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<br>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultCategoryCar").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectExpenseCategories($fuser->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultRangeNumber").'</td>';
|
||||
print '<td>';
|
||||
$maxRangeNum = ExpenseReportIk::getMaxRangeNumber($fuser->default_c_exp_tax_cat);
|
||||
print $form->selectarray('default_range', range(0, $maxRangeNum), $fuser->default_range);
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DefaultCategoryCar").'</td>';
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
print dol_getIdFromCode($db, $fuser->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultRangeNumber").'</td>';
|
||||
print '<td>';
|
||||
print $fuser->default_range;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||
{
|
||||
@ -370,17 +454,31 @@ if ($resql)
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
$canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id));
|
||||
|
||||
// Boutons d'actions
|
||||
if ($canedit)
|
||||
if ($action != 'edit')
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=request&id='.$user_id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
||||
}
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
print '</div>';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$user_id.'" class="butAction">'.$langs->trans("Modify").'</a>';
|
||||
}
|
||||
|
||||
$canedit=(($user->id == $user_id && $user->rights->expensereport->creer) || ($user->id != $user_id));
|
||||
|
||||
// Boutons d'actions
|
||||
if ($canedit)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=request&id='.$user_id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '</div><br>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -653,22 +751,22 @@ if ($resql)
|
||||
}
|
||||
// Start date
|
||||
if (! empty($arrayfields['d.date_debut']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_debut > 0 ? dol_print_date($obj->date_debut, 'day') : '').'</td>';
|
||||
print '<td align="center">'.($obj->date_debut > 0 ? dol_print_date($db->jdate($obj->date_debut), 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// End date
|
||||
if (! empty($arrayfields['d.date_fin']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_fin > 0 ? dol_print_date($obj->date_fin, 'day') : '').'</td>';
|
||||
print '<td align="center">'.($obj->date_fin > 0 ? dol_print_date($db->jdate($obj->date_fin), 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date validation
|
||||
if (! empty($arrayfields['d.date_valid']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_valid > 0 ? dol_print_date($obj->date_valid, 'day') : '').'</td>';
|
||||
print '<td align="center">'.($obj->date_valid > 0 ? dol_print_date($db->jdate($obj->date_valid), 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date approval
|
||||
if (! empty($arrayfields['d.date_approve']['checked'])) {
|
||||
print '<td align="center">'.($obj->date_approve > 0 ? dol_print_date($obj->date_approve, 'day') : '').'</td>';
|
||||
print '<td align="center">'.($obj->date_approve > 0 ? dol_print_date($db->jdate($obj->date_approve), 'day') : '').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Amount HT
|
||||
|
||||
@ -1170,8 +1170,6 @@ RuleForGeneratedPasswords=Rule to generate suggested passwords or validate passw
|
||||
DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page
|
||||
UsersSetup=Users module setup
|
||||
UserMailRequired=EMail required to create a new user
|
||||
DefaultCategoryCar=Default car category
|
||||
DefaultRangeNumber=Default range number
|
||||
##### HRM setup #####
|
||||
HRMSetup=HRM module setup
|
||||
##### Company setup #####
|
||||
|
||||
@ -73,6 +73,8 @@ EX_FUE_VP=Fuel PV
|
||||
EX_TOL_VP=Toll PV
|
||||
EX_PAR_VP=Parking PV
|
||||
EX_CAM_VP=PV maintenance and repair
|
||||
DefaultCategoryCar=Default transportation mode
|
||||
DefaultRangeNumber=Default range number
|
||||
|
||||
ErrorDoubleDeclaration=You have declared another expense report into a similar date range.
|
||||
AucuneLigne=There is no expense report declared yet
|
||||
|
||||
@ -39,7 +39,7 @@ VirtualHostUrlNotDefined=URL of the virtual host served by external web server n
|
||||
NoPageYet=No pages yet
|
||||
SyntaxHelp=Help on specific syntax tips
|
||||
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
|
||||
YouCanEditHtmlSource=You can include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br>You can also include content of another Page/Container with the following syntax:<br><strong><?php dolIncludeHtmlContent($websitekey.'/alias_of_content_to_include.php'); ?></strong><br><br>To include a <strong>link to download</strong> a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong><a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext"></strong><br>For same file into documents/ecm (open access using the sharing hash key), syntax is:<br><strong><a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile"></strong><br>For a file into documents/media (open directory for public access), syntax is:<br><strong><a href="/document.php?modulepart=medias&file=relative_dir/filename.ext"></strong><br><br>To include an <strong>image</strong> stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong><a href="/viewimage.php?modulepart=medias&file=relative_dir/filename.ext"></strong>
|
||||
YouCanEditHtmlSource=<br><span class="fa fa-bug"></span> You can include PHP code into this source using tags <strong><?php ?></strong>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.<br><br><span class="fa fa-bug"></span> You can also include content of another Page/Container with the following syntax:<br><strong><?php dolIncludeHtmlContent($websitekey.'/alias_of_container_to_include.php'); ?></strong><br><br><span class="fa fa-download"></span> To include a <strong>link to download</strong> a file stored into the <strong>documents</strong> directory, use the <strong>document.php</strong> wrapper:<br>Example, for a file into documents/ecm (need to be logged), syntax is:<br><strong><a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext"></strong><br>For same file into documents/ecm (open access using the sharing hash key), syntax is:<br><strong><a href="/document.php?modulepart=ecm&file=relative_dir/filename.ext&hashp=publicsharekeyoffile"></strong><br>For a file into documents/media (open directory for public access), syntax is:<br><strong><a href="/document.php?modulepart=medias&file=relative_dir/filename.ext"></strong><br><br><span class="fa fa-picture-o"></span> To include an <strong>image</strong> stored into the <strong>documents</strong> directory, use the <strong>viewimage.php</strong> wrapper:<br>Example, for an image into documents/media (open access), syntax is:<br><strong><a href="/viewimage.php?modulepart=medias&file=relative_dir/filename.ext"></strong><br>
|
||||
ClonePage=Clone page/container
|
||||
CloneSite=Clone site
|
||||
ConfirmClonePage=Please enter code/alias of new page and if it is a translation of the cloned page.
|
||||
|
||||
@ -312,18 +312,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$var=true;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/salaries/index.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastSalaries",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/compta/salaries/index.php?search_user='.$object->login.'">'.$langs->trans("AllSalaries").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
@ -343,7 +339,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num > 0) print "</table>";
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -369,18 +366,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$var=true;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastHolidays",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/holiday/list.php?id='.$object->id.'">'.$langs->trans("AllHolidays").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastHolidays",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/holiday/list.php?id='.$object->id.'">'.$langs->trans("AllHolidays").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
@ -402,7 +395,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num > 0) print "</table>";
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -428,18 +422,14 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$var=true;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expensereport/list.php?id='.$object->id.'">'.$langs->trans("AllExpenseReports").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastExpenseReports",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a class="notasortlink" href="'.DOL_URL_ROOT.'/expensereport/list.php?id='.$object->id.'">'.$langs->trans("AllExpenseReports").' <span class="badge">'.$num.'</span></a></td>';
|
||||
print '</tr></table></td>';
|
||||
print '</tr>';
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
@ -460,7 +450,8 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
if ($num > 0) print "</table>";
|
||||
if ($num <= 0) print '<td colspan="4" class="opacitymedium">'.$langs->trans("None").'</a>';
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -46,7 +46,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
@ -370,9 +369,6 @@ if (empty($reshook)) {
|
||||
$dateemployment = dol_mktime(0, 0, 0, GETPOST('dateemploymentmonth'), GETPOST('dateemploymentday'), GETPOST('dateemploymentyear'));
|
||||
$object->dateemployment = $dateemployment;
|
||||
|
||||
$object->default_range = GETPOST('default_range');
|
||||
$object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat');
|
||||
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if (! empty($_POST["superadmin"]))
|
||||
@ -1126,20 +1122,6 @@ if ($action == 'create' || $action == 'adduserldap')
|
||||
}
|
||||
*/
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DefaultCategoryCar").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectExpenseCategories($object->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultRangeNumber").'</td>';
|
||||
print '<td>';
|
||||
$maxRangeNum = ExpenseReportIk::getMaxRangeNumber($object->default_c_exp_tax_cat);
|
||||
print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
@ -1540,19 +1522,6 @@ else
|
||||
print '<td>'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DefaultCategoryCar").'</td>';
|
||||
print '<td class="fk_c_exp_tax_cat">';
|
||||
print dol_getIdFromCode($db, $object->default_c_exp_tax_cat, 'c_exp_tax_cat', 'rowid', 'label');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultRangeNumber").'</td>';
|
||||
print '<td>';
|
||||
print $object->default_range;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Multicompany
|
||||
// This is now done with hook formObjectOptions (included into /core/tpl/extrafields_view.tpl.php)
|
||||
/*
|
||||
@ -1737,81 +1706,6 @@ else
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
|
||||
/*
|
||||
if ($action == 'presend')
|
||||
{
|
||||
// Show email form
|
||||
|
||||
// By default if $action=='presend'
|
||||
$titreform='SendMail';
|
||||
$topicmail=1;
|
||||
$action='send';
|
||||
$modelmail='user';
|
||||
|
||||
print '<div id="formmailbeforetitle" name="formmailbeforetitle"></div>';
|
||||
print '<div id="presend"></div>';
|
||||
print load_fiche_titre($langs->trans($titreform));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id']))
|
||||
$newlang = $_REQUEST['lang_id'];
|
||||
//if ($conf->global->MAIN_MULTILANGS && empty($newlang))
|
||||
// $newlang = $object->thirdparty->default_lang;
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
|
||||
$formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
|
||||
if($formmail->fromtype === 'user'){
|
||||
$formmail->fromid = $user->id;
|
||||
|
||||
}
|
||||
$formmail->trackid='thi'.$object->id;
|
||||
if (! empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) // If bit 2 is set
|
||||
{
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$formmail->frommail=dolAddEmailTrackId($formmail->frommail, 'thi'.$object->id);
|
||||
}
|
||||
$formmail->withfrom=1;
|
||||
$formmail->withtopic=$topicmail;
|
||||
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$object->email;
|
||||
$formmail->withtofree=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withfile=2;
|
||||
$formmail->withbody=1;
|
||||
$formmail->withdeliveryreceipt=1;
|
||||
$formmail->withcancel=1;
|
||||
// Tableau des substitutions
|
||||
$formmail->setSubstitFromObject($object, $outputlangs);
|
||||
$formmail->substit['__LASTNAME__']=$object->lastname;
|
||||
$formmail->substit['__FIRSTNAME__']=$object->firstname;
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action']=$action;
|
||||
$formmail->param['models']=$modelmail;
|
||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||
$formmail->param['socid']=$object->id;
|
||||
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
|
||||
// Init list of files
|
||||
if (GETPOST("mode")=='init')
|
||||
{
|
||||
$formmail->clear_attached_files();
|
||||
$formmail->add_attached_files($file,basename($file),dol_mimetype($file));
|
||||
}
|
||||
print $formmail->get_form();
|
||||
|
||||
dol_fiche_end();
|
||||
}
|
||||
*/
|
||||
|
||||
if (GETPOST('action','aZ09') != 'presend' && GETPOST('action','aZ09') != 'send')
|
||||
{
|
||||
/*
|
||||
@ -2481,20 +2375,6 @@ else
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("DefaultCategoryCar").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectExpenseCategories($object->default_c_exp_tax_cat, 'default_c_exp_tax_cat', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("DefaultRangeNumber").'</td>';
|
||||
print '<td>';
|
||||
$maxRangeNum = ExpenseReportIk::getMaxRangeNumber($object->default_c_exp_tax_cat);
|
||||
print $form->selectarray('default_range', range(0, $maxRangeNum), $object->default_range);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Multicompany
|
||||
// This is now done with hook formObjectOptions
|
||||
/*
|
||||
|
||||
@ -201,7 +201,7 @@ class User extends CommonObject
|
||||
$sql.= " u.color,";
|
||||
$sql.= " u.dateemployment,";
|
||||
$sql.= " u.ref_int, u.ref_ext,";
|
||||
$sql.= " u.default_range, u.default_c_exp_tax_cat,";
|
||||
$sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode
|
||||
$sql.= " c.code as country_code, c.label as country,";
|
||||
$sql.= " d.code_departement as state_code, d.nom as state";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
@ -1386,7 +1386,7 @@ if (count($object->records) > 0)
|
||||
if (GETPOST('editsource', 'alpha') || GETPOST('editcontent', 'alpha'))
|
||||
{
|
||||
$htmltext=$langs->transnoentitiesnoconv("YouCanEditHtmlSource");
|
||||
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 0, 2, 'tooltipsubstitution');
|
||||
print $form->textwithpicto($langs->trans("SyntaxHelp"), $htmltext, 1, 'help', 'inline-block', 1, 2, 'tooltipsubstitution');
|
||||
}
|
||||
print '</div>'; // end websitehelp
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user