Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/admin/delais.php
This commit is contained in:
commit
eee49b9132
@ -33,7 +33,9 @@ $langs->load("admin");
|
|||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
if (empty($action)) $action = 'edit';
|
||||||
|
|
||||||
|
// Define list of managed delays
|
||||||
$modules = array(
|
$modules = array(
|
||||||
'agenda' => array(
|
'agenda' => array(
|
||||||
array(
|
array(
|
||||||
@ -190,6 +192,10 @@ if ($action == 'update')
|
|||||||
for ($i = 0; $i < 4; $i++) {
|
for ($i = 0; $i < 4; $i++) {
|
||||||
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||||
|
|
||||||
|
$action = 'edit';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -315,7 +315,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_validation, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_validation, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_validation, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_validation, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
@ -349,7 +349,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_approve, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_approve, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
@ -377,7 +377,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_approve2, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_approve2, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve2, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_approve2, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
@ -413,7 +413,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_closing, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_closing, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_closing, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_closing, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
@ -447,7 +447,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_rappro, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_rappro, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_rappro, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_rappro, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ function dol_print_object_info($object, $usetable = 0)
|
|||||||
if ($usetable) print '</td><td>';
|
if ($usetable) print '</td><td>';
|
||||||
else print ': ';
|
else print ': ';
|
||||||
print dol_print_date($object->date_envoi, 'dayhour', 'tzserver');
|
print dol_print_date($object->date_envoi, 'dayhour', 'tzserver');
|
||||||
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_envoi, "dayhour", 'tzserver').' '.$langs->trans("ClientHour");
|
if ($deltadateforuser) print ' '.$langs->trans("CurrentHour").' / '.dol_print_date($object->date_envoi, "dayhour", 'tzuserrel').' '.$langs->trans("ClientHour");
|
||||||
if ($usetable) print '</td></tr>';
|
if ($usetable) print '</td></tr>';
|
||||||
else print '<br>';
|
else print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,11 @@ function holiday_prepare_head($object)
|
|||||||
$head[$h][2] = 'documents';
|
$head[$h][2] = 'documents';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/holiday/info.php?id='.$object->id;
|
||||||
|
$head[$h][1] = $langs->trans("Info");
|
||||||
|
$head[$h][2] = 'info';
|
||||||
|
$h++;
|
||||||
|
|
||||||
// Show more tabs from modules
|
// Show more tabs from modules
|
||||||
// Entries must be declared in modules descriptor with line
|
// Entries must be declared in modules descriptor with line
|
||||||
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
||||||
|
|||||||
@ -198,8 +198,8 @@ class MenuManager
|
|||||||
$submenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
$submenu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
||||||
$submenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
$submenu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
||||||
|
|
||||||
$submenu->add("/admin/boxes.php", $langs->trans("Boxes"), 1);
|
$submenu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1);
|
||||||
$submenu->add("/admin/delais.php", $langs->trans("Alerts"), 1);
|
$submenu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1);
|
||||||
$submenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
$submenu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
||||||
$submenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
$submenu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
||||||
$submenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
$submenu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||||
@ -340,8 +340,8 @@ class MenuManager
|
|||||||
$this->menu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
$this->menu->add("/admin/translation.php?mainmenu=home", $langs->trans("Translation"), 1);
|
||||||
$this->menu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
$this->menu->add("/admin/defaultvalues.php?mainmenu=home", $langs->trans("DefaultValues"), 1);
|
||||||
|
|
||||||
$this->menu->add("/admin/boxes.php", $langs->trans("Boxes"), 1);
|
$this->menu->add("/admin/boxes.php?mainmenu=home", $langs->trans("Boxes"), 1);
|
||||||
$this->menu->add("/admin/delais.php", $langs->trans("Alerts"), 1);
|
$this->menu->add("/admin/delais.php?mainmenu=home", $langs->trans("Alerts"), 1);
|
||||||
$this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
$this->menu->add("/admin/proxy.php?mainmenu=home", $langs->trans("Security"), 1);
|
||||||
$this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
$this->menu->add("/admin/limits.php?mainmenu=home", $langs->trans("MenuLimits"), 1);
|
||||||
$this->menu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
$this->menu->add("/admin/pdf.php?mainmenu=home", $langs->trans("PDF"), 1);
|
||||||
|
|||||||
@ -976,34 +976,6 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'set_unpaid' && $id > 0 && $user->rights->expensereport->to_paid)
|
|
||||||
{
|
|
||||||
$object = new ExpenseReport($db);
|
|
||||||
$object->fetch($id);
|
|
||||||
|
|
||||||
$result = $object->set_unpaid($user);
|
|
||||||
|
|
||||||
if ($result > 0)
|
|
||||||
{
|
|
||||||
// Define output language
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
|
||||||
{
|
|
||||||
$outputlangs = $langs;
|
|
||||||
$newlang = '';
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09');
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $object->thirdparty->default_lang;
|
|
||||||
if (!empty($newlang)) {
|
|
||||||
$outputlangs = new Translate("", $conf);
|
|
||||||
$outputlangs->setDefaultLang($newlang);
|
|
||||||
}
|
|
||||||
$model = $object->model_pdf;
|
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
|
||||||
|
|
||||||
$object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||||
{
|
{
|
||||||
$object = new ExpenseReport($db);
|
$object = new ExpenseReport($db);
|
||||||
@ -1492,8 +1464,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
if ($id > 0 || $ref)
|
if ($id > 0 || $ref) {
|
||||||
{
|
|
||||||
$result = $object->fetch($id, $ref);
|
$result = $object->fetch($id, $ref);
|
||||||
|
|
||||||
$res = $object->fetch_optionals();
|
$res = $object->fetch_optionals();
|
||||||
@ -1755,6 +1726,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Period
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
print '<td class="titlefield">'.$langs->trans("Period").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -1772,9 +1744,9 @@ if ($action == 'create')
|
|||||||
// Validation date
|
// Validation date
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
print '<td>'.$langs->trans("DATE_SAVE").'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour');
|
print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser');
|
||||||
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late"));
|
if ($object->status == 2 && $object->hasDelay('toapprove')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove"));
|
||||||
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late"));
|
if ($object->status == 5 && $object->hasDelay('topay')) print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay"));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -1815,7 +1787,7 @@ if ($action == 'create')
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DATE_CANCEL").'</td>';
|
print '<td>'.$langs->trans("DATE_CANCEL").'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour').'</td></tr>';
|
print '<td>'.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'</td></tr>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
@ -1831,7 +1803,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DateApprove").'</td>';
|
print '<td>'.$langs->trans("DateApprove").'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_approve, 'dayhour').'</td></tr>';
|
print '<td>'.dol_print_date($object->date_approve, 'dayhour', 'tzuser').'</td></tr>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1847,7 +1819,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DATE_REFUS").'</td>';
|
print '<td>'.$langs->trans("DATE_REFUS").'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour');
|
print '<td>'.dol_print_date($object->date_refuse, 'dayhour', 'tzuser');
|
||||||
if ($object->detail_refuse) print ' - '.$object->detail_refuse;
|
if ($object->detail_refuse) print ' - '.$object->detail_refuse;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -256,6 +256,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= ",date_debut";
|
$sql .= ",date_debut";
|
||||||
$sql .= ",date_fin";
|
$sql .= ",date_fin";
|
||||||
$sql .= ",date_create";
|
$sql .= ",date_create";
|
||||||
|
$sql .= ",fk_user_creat";
|
||||||
$sql .= ",fk_user_author";
|
$sql .= ",fk_user_author";
|
||||||
$sql .= ",fk_user_validator";
|
$sql .= ",fk_user_validator";
|
||||||
$sql .= ",fk_user_approve";
|
$sql .= ",fk_user_approve";
|
||||||
@ -274,6 +275,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= ", '".$this->db->idate($this->date_debut)."'";
|
$sql .= ", '".$this->db->idate($this->date_debut)."'";
|
||||||
$sql .= ", '".$this->db->idate($this->date_fin)."'";
|
$sql .= ", '".$this->db->idate($this->date_fin)."'";
|
||||||
$sql .= ", '".$this->db->idate($now)."'";
|
$sql .= ", '".$this->db->idate($now)."'";
|
||||||
|
$sql .= ", ".$user->id;
|
||||||
$sql .= ", ".$fuserid;
|
$sql .= ", ".$fuserid;
|
||||||
$sql .= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator : "null");
|
$sql .= ", ".($this->fk_user_validator > 0 ? $this->fk_user_validator : "null");
|
||||||
$sql .= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve : "null");
|
$sql .= ", ".($this->fk_user_approve > 0 ? $this->fk_user_approve : "null");
|
||||||
@ -419,6 +421,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->fk_statut = 0; // deprecated
|
$this->fk_statut = 0; // deprecated
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
|
$this->fk_user_creat = $user->id;
|
||||||
$this->fk_user_author = $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
$this->fk_user_author = $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
||||||
$this->fk_user_valid = '';
|
$this->fk_user_valid = '';
|
||||||
$this->date_create = '';
|
$this->date_create = '';
|
||||||
@ -548,7 +551,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
$sql .= " d.date_refuse, d.date_cancel,"; // ACTIONS
|
||||||
$sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
$sql .= " d.total_ht, d.total_ttc, d.total_tva,"; // TOTAUX (int)
|
||||||
$sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime)
|
$sql .= " d.date_debut, d.date_fin, d.date_create, d.tms as date_modif, d.date_valid, d.date_approve,"; // DATES (datetime)
|
||||||
$sql .= " d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
|
$sql .= " d.fk_user_creat, d.fk_user_author, d.fk_user_modif, d.fk_user_validator,";
|
||||||
$sql .= " d.fk_user_valid, d.fk_user_approve,";
|
$sql .= " d.fk_user_valid, d.fk_user_approve,";
|
||||||
$sql .= " d.fk_statut as status, d.fk_c_paiement, d.paid";
|
$sql .= " d.fk_statut as status, d.fk_c_paiement, d.paid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as d";
|
||||||
@ -585,6 +588,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$this->date_refuse = $this->db->jdate($obj->date_refuse);
|
$this->date_refuse = $this->db->jdate($obj->date_refuse);
|
||||||
$this->date_cancel = $this->db->jdate($obj->date_cancel);
|
$this->date_cancel = $this->db->jdate($obj->date_cancel);
|
||||||
|
|
||||||
|
$this->fk_user_creat = $obj->fk_user_creat;
|
||||||
$this->fk_user_author = $obj->fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
$this->fk_user_author = $obj->fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
||||||
$this->fk_user_modif = $obj->fk_user_modif;
|
$this->fk_user_modif = $obj->fk_user_modif;
|
||||||
$this->fk_user_validator = $obj->fk_user_validator;
|
$this->fk_user_validator = $obj->fk_user_validator;
|
||||||
@ -733,7 +737,7 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql .= " f.tms as date_modification,";
|
$sql .= " f.tms as date_modification,";
|
||||||
$sql .= " f.date_valid as datev,";
|
$sql .= " f.date_valid as datev,";
|
||||||
$sql .= " f.date_approve as datea,";
|
$sql .= " f.date_approve as datea,";
|
||||||
//$sql.= " f.fk_user_author as fk_user_creation,"; // This is not user of creation but user the expense is for.
|
$sql .= " f.fk_user_creat as fk_user_creation,";
|
||||||
$sql .= " f.fk_user_modif as fk_user_modification,";
|
$sql .= " f.fk_user_modif as fk_user_modification,";
|
||||||
$sql .= " f.fk_user_valid,";
|
$sql .= " f.fk_user_valid,";
|
||||||
$sql .= " f.fk_user_approve";
|
$sql .= " f.fk_user_approve";
|
||||||
@ -2454,10 +2458,11 @@ class ExpenseReport extends CommonObject
|
|||||||
if ($option == 'topay' && $this->status != 5) return false;
|
if ($option == 'topay' && $this->status != 5) return false;
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
if ($option == 'toapprove')
|
if ($option == 'toapprove') {
|
||||||
{
|
|
||||||
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
||||||
} else return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
} else {
|
||||||
|
return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1369,24 +1369,24 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
|
|||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_create, 'dayhour').'</td>';
|
print '<td>'.dol_print_date($object->date_create, 'dayhour', 'tzuser').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_valid, 'dayhour').'</td>'; // warning: date_valid is approval date on holiday module
|
print '<td>'.dol_print_date($object->date_valid, 'dayhour', 'tzuser').'</td>'; // warning: date_valid is approval date on holiday module
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
if ($object->statut == Holiday::STATUS_CANCELED) {
|
if ($object->statut == Holiday::STATUS_CANCELED) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('DateCancelCP').'</td>';
|
print '<td>'.$langs->trans('DateCancelCP').'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour').'</td>';
|
print '<td>'.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
if ($object->statut == Holiday::STATUS_REFUSED) {
|
if ($object->statut == Holiday::STATUS_REFUSED) {
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans('DateRefusCP').'</td>';
|
print '<td>'.$langs->trans('DateRefusCP').'</td>';
|
||||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour').'</td>';
|
print '<td>'.dol_print_date($object->date_refuse, 'dayhour', 'tzuser').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
print '</tbody>';
|
print '</tbody>';
|
||||||
|
|||||||
@ -2073,6 +2073,81 @@ class Holiday extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load information on object
|
||||||
|
*
|
||||||
|
* @param int $id Id of object
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function info($id)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
$sql = "SELECT f.rowid,";
|
||||||
|
$sql .= " f.date_create as datec,";
|
||||||
|
$sql .= " f.tms as date_modification,";
|
||||||
|
$sql .= " f.date_valid as datev,";
|
||||||
|
//$sql .= " f.date_approve as datea,";
|
||||||
|
$sql .= " f.date_refuse as dater,";
|
||||||
|
$sql .= " f.fk_user_create as fk_user_creation,";
|
||||||
|
$sql .= " f.fk_user_modif as fk_user_modification,";
|
||||||
|
$sql .= " f.fk_user_valid,";
|
||||||
|
$sql .= " f.fk_validator as fk_user_approve,";
|
||||||
|
$sql .= " f.fk_user_refuse as fk_user_refuse";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as f";
|
||||||
|
$sql .= " WHERE f.rowid = ".$id;
|
||||||
|
$sql .= " AND f.entity = ".$conf->entity;
|
||||||
|
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
if ($this->db->num_rows($resql))
|
||||||
|
{
|
||||||
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
|
$this->id = $obj->rowid;
|
||||||
|
|
||||||
|
$this->date_creation = $this->db->jdate($obj->datec);
|
||||||
|
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||||
|
$this->date_validation = $this->db->jdate($obj->datev);
|
||||||
|
$this->date_approbation = $this->db->jdate($obj->datea);
|
||||||
|
|
||||||
|
$cuser = new User($this->db);
|
||||||
|
$cuser->fetch($obj->fk_user_author);
|
||||||
|
$this->user_creation = $cuser;
|
||||||
|
|
||||||
|
if ($obj->fk_user_creation)
|
||||||
|
{
|
||||||
|
$cuser = new User($this->db);
|
||||||
|
$cuser->fetch($obj->fk_user_creation);
|
||||||
|
$this->user_creation = $cuser;
|
||||||
|
}
|
||||||
|
if ($obj->fk_user_valid)
|
||||||
|
{
|
||||||
|
$vuser = new User($this->db);
|
||||||
|
$vuser->fetch($obj->fk_user_valid);
|
||||||
|
$this->user_validation = $vuser;
|
||||||
|
}
|
||||||
|
if ($obj->fk_user_modification)
|
||||||
|
{
|
||||||
|
$muser = new User($this->db);
|
||||||
|
$muser->fetch($obj->fk_user_modification);
|
||||||
|
$this->user_modification = $muser;
|
||||||
|
}
|
||||||
|
if ($obj->fk_user_approve)
|
||||||
|
{
|
||||||
|
$auser = new User($this->db);
|
||||||
|
$auser->fetch($obj->fk_user_approve);
|
||||||
|
$this->user_approve = $auser;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->db->free($resql);
|
||||||
|
} else {
|
||||||
|
dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialise an instance with random values.
|
* Initialise an instance with random values.
|
||||||
* Used to build previews or test instances.
|
* Used to build previews or test instances.
|
||||||
|
|||||||
106
htdocs/holiday/info.php
Normal file
106
htdocs/holiday/info.php
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
* or see https://www.gnu.org/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/holiday/info.php
|
||||||
|
* \ingroup holiday
|
||||||
|
* \brief Page to show a leave information
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->load("holiday");
|
||||||
|
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$ref = GETPOST('ref', 'alpha');
|
||||||
|
|
||||||
|
$childids = $user->getAllChildIds(1);
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid) $socid = $user->socid;
|
||||||
|
$result = restrictedArea($user, 'holiday', $id, 'holiday');
|
||||||
|
|
||||||
|
$object = new Holiday($db);
|
||||||
|
if (!$object->fetch($id, $ref) > 0)
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($object->id > 0)
|
||||||
|
{
|
||||||
|
// Check current user can read this expense report
|
||||||
|
$canread = 0;
|
||||||
|
if (!empty($user->rights->holiday->readall)) $canread = 1;
|
||||||
|
if (!empty($user->rights->holiday->lire) && in_array($object->fk_user_author, $childids)) $canread = 1;
|
||||||
|
if (!$canread)
|
||||||
|
{
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans("Holiday")." - ".$langs->trans("Info");
|
||||||
|
$helpurl = "";
|
||||||
|
llxHeader("", $title, $helpurl);
|
||||||
|
|
||||||
|
if ($id > 0 || !empty($ref))
|
||||||
|
{
|
||||||
|
$object = new Holiday($db);
|
||||||
|
$object->fetch($id, $ref);
|
||||||
|
$object->info($object->id);
|
||||||
|
|
||||||
|
$head = holiday_prepare_head($object);
|
||||||
|
|
||||||
|
print dol_get_fiche_head($head, 'info', $langs->trans("Holiday"), -1, 'holiday');
|
||||||
|
|
||||||
|
$linkback = '<a href="'.DOL_URL_ROOT.'/holiday/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
$morehtmlref = '<div class="refidno">';
|
||||||
|
$morehtmlref .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
|
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||||
|
|
||||||
|
print '<div class="fichecenter">';
|
||||||
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
print '<table width="100%"><tr><td>';
|
||||||
|
dol_print_object_info($object);
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print dol_get_fiche_end();
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -102,7 +102,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
|
|||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',211);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',212);
|
||||||
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141);
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PROJECT_VALIDATE','Project validation','Executed when a project is validated','project',141);
|
||||||
|
|||||||
@ -569,5 +569,12 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN packaging varchar(64);
|
|||||||
|
|
||||||
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
ALTER TABLE llx_projet ADD COLUMN fk_opp_status_end integer DEFAULT NULL;
|
||||||
|
|
||||||
|
UPDATE llx_c_action_trigger SET elementtype = 'expensereport' where elementtype = 'expense_report' AND code like 'EXPENSE_%';
|
||||||
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_PAID' where code = 'EXPENSE_REPORT_PAYED';
|
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_PAID' where code = 'EXPENSE_REPORT_PAYED';
|
||||||
|
UPDATE llx_c_action_trigger SET code = 'EXPENSE_REPORT_DELETE' where code = 'EXPENSE_DELETE';
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expensereport',201);
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202);
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203);
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAID','Expense report billed','Executed when an expense report is set as billed','expensereport',204);
|
||||||
|
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_DELETE','Expense report deleted','Executed when an expense report is deleted','expensereport',205);
|
||||||
|
|
||||||
|
|||||||
@ -119,6 +119,7 @@ MRP_MO_UNVALIDATEInDolibarr=MO set to draft status
|
|||||||
MRP_MO_PRODUCEDInDolibarr=MO produced
|
MRP_MO_PRODUCEDInDolibarr=MO produced
|
||||||
MRP_MO_DELETEInDolibarr=MO deleted
|
MRP_MO_DELETEInDolibarr=MO deleted
|
||||||
MRP_MO_CANCELInDolibarr=MO canceled
|
MRP_MO_CANCELInDolibarr=MO canceled
|
||||||
|
PAIDInDolibarr=%s paid
|
||||||
##### End agenda events #####
|
##### End agenda events #####
|
||||||
AgendaModelModule=Document templates for event
|
AgendaModelModule=Document templates for event
|
||||||
DateActionStart=Start date
|
DateActionStart=Start date
|
||||||
|
|||||||
@ -634,7 +634,8 @@ if ($id > 0 || !empty($ref))
|
|||||||
// List of actions on element
|
// List of actions on element
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, 'task', $socid, 1, '', 10, 'withproject='.$withproject);
|
$defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid;
|
||||||
|
$formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject);
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user