Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/comm/action/index.php htdocs/langs/en_US/errors.lang
This commit is contained in:
commit
2142440b6c
@ -186,35 +186,55 @@ class CActionComm
|
|||||||
|
|
||||||
$qualified = 1;
|
$qualified = 1;
|
||||||
|
|
||||||
// $obj->type can be system, systemauto, module, moduleauto, xxx, xxxauto
|
// $obj->type can be 'system', 'systemauto', 'module', 'moduleauto', 'xxx', 'xxxauto'
|
||||||
|
// Note: type = system... than type of event is added among other standard events.
|
||||||
|
// type = module... then type of event is grouped into module defined into module = myobject@mymodule. Example: Event organization or external modules
|
||||||
|
// type = xxx... then type of event is added into list as a new flat value (not grouped). Example: Agefod external module
|
||||||
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
|
if ($qualified && $onlyautoornot > 0 && preg_match('/^system/', $obj->type) && !preg_match('/^AC_OTH/', $obj->code)) {
|
||||||
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
|
$qualified = 0; // We discard detailed system events. We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($qualified && !empty($obj->module)) {
|
if ($qualified && !empty($obj->module)) {
|
||||||
if ($obj->module == 'invoice' && empty($conf->facture->enabled) && empty($user->facture->lire)) {
|
//var_dump($obj->type.' '.$obj->module.' '); var_dump($user->rights->facture->lire);
|
||||||
$qualified = 0;
|
$qualified = 0;
|
||||||
|
// Special cases
|
||||||
|
if ($obj->module == 'invoice' && !empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
|
||||||
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order' && empty($conf->commande->enabled) && empty($user->commande->lire)) {
|
if ($obj->module == 'order' && !empty($conf->commande->enabled) && empty($user->rights->commande->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'propal' && empty($conf->propal->enabled) && empty($user->propale->lire)) {
|
if ($obj->module == 'propal' && !empty($conf->propal->enabled) && !empty($user->rights->propale->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->facture->lire)) || (!empty($conf->supplier_invoice->enabled) && empty($user->supplier_invoice->lire)))) {
|
if ($obj->module == 'invoice_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->facture->lire)) || (!empty($conf->rights->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && empty($user->fournisseur->commande->lire)) || (empty($conf->supplier_order->enabled) && empty($user->supplier_order->lire)))) {
|
if ($obj->module == 'order_supplier' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && !empty($user->rights->fournisseur->commande->lire)) || (empty($conf->rights->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)))) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if ($obj->module == 'shipping' && empty($conf->expedition->enabled) && empty($user->expedition->lire)) {
|
if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) {
|
||||||
$qualified = 0;
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if (preg_match('/@eventorganization/', $obj->module) && empty($conf->eventorganization->enabled) && empty($user->eventorganization->read)) {
|
// For the generic case with type = 'module...' and module = 'myobject@mymodule'
|
||||||
$qualified = 0;
|
$regs = array();
|
||||||
|
if (preg_match('/^module/', $obj->type)) {
|
||||||
|
if (preg_match('/^(.+)@(.+)$/', $obj->module, $regs)) {
|
||||||
|
$tmpobject = $regs[1];
|
||||||
|
$tmpmodule = $regs[2];
|
||||||
|
//var_dump($user->$tmpmodule);
|
||||||
|
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled) && (!empty($user->rights->$tmpmodule->read) || !empty($user->rights->$tmpmodule->lire) || !empty($user->rights->$tmpmodule->$tmpobject->read) || !empty($user->rights->$tmpmodule->$tmpobject->lire))) {
|
||||||
|
$qualified = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// For the case type is not 'system...' neither 'module', we just check module is on
|
||||||
|
if (! in_array($obj->type, array('system', 'systemauto', 'module', 'moduleauto'))) {
|
||||||
|
$tmpmodule = $obj->module;
|
||||||
|
//var_dump($tmpmodule);
|
||||||
|
if ($tmpmodule && isset($conf->$tmpmodule) && !empty($conf->$tmpmodule->enabled)) {
|
||||||
|
$qualified = 1;
|
||||||
}
|
}
|
||||||
if (!preg_match('/^system/', $obj->type) && isset($conf->{$obj->module}) && empty($conf->{$obj->module}->enabled)) {
|
|
||||||
$qualified = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,7 @@ if (empty($conf->global->AGENDA_EXT_NB)) {
|
|||||||
}
|
}
|
||||||
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
$MAXAGENDA = $conf->global->AGENDA_EXT_NB;
|
||||||
|
|
||||||
|
$check_holiday = GETPOST('check_holiday', 'int');
|
||||||
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
|
$filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3);
|
||||||
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
|
$filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3);
|
||||||
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
$usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3);
|
||||||
@ -579,10 +580,10 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
|||||||
$s .= '</script>'."\n";
|
$s .= '</script>'."\n";
|
||||||
|
|
||||||
// Local calendar
|
// Local calendar
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" value="1" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
||||||
|
|
||||||
// Holiday calendar
|
// Holiday calendar
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_holiday" name="check_holiday" value="1" class="check_holiday"'.($check_holiday ? ' checked' : '').'><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> </div>';
|
||||||
|
|
||||||
// External calendars
|
// External calendars
|
||||||
if (is_array($showextcals) && count($showextcals) > 0) {
|
if (is_array($showextcals) && count($showextcals) > 0) {
|
||||||
@ -607,13 +608,13 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on
|
|||||||
foreach ($showextcals as $val) {
|
foreach ($showextcals as $val) {
|
||||||
$htmlname = md5($val['name']);
|
$htmlname = md5($val['name']);
|
||||||
|
|
||||||
if (!empty($val['default'])) {
|
if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) {
|
||||||
$default = "checked";
|
$default = "checked";
|
||||||
} else {
|
} else {
|
||||||
$default = '';
|
$default = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_ext'.$htmlname.'" name="check_ext'.$htmlname.'" value="1" '.$default.'> <label for="check_ext'.$htmlname.'">'.$val['name'].'</label> </div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -848,6 +849,7 @@ if ($resql) {
|
|||||||
$event->fk_project = $obj->fk_project;
|
$event->fk_project = $obj->fk_project;
|
||||||
|
|
||||||
$event->socid = $obj->fk_soc;
|
$event->socid = $obj->fk_soc;
|
||||||
|
$event->thirdparty_id = $obj->fk_soc;
|
||||||
$event->contact_id = $obj->fk_contact;
|
$event->contact_id = $obj->fk_contact;
|
||||||
|
|
||||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||||
|
|||||||
@ -41,12 +41,7 @@ $ref = GETPOST('ref', 'alpha');
|
|||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
|
||||||
// Security check
|
$object = new RemiseCheque($db);
|
||||||
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
|
|
||||||
if ($user->socid) {
|
|
||||||
$socid = $user->socid;
|
|
||||||
}
|
|
||||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
|
|
||||||
|
|
||||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
@ -63,11 +58,22 @@ if (empty($page) || $page == -1) {
|
|||||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|
||||||
$dir = $conf->bank->dir_output.'/checkdeposits/';
|
$upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits";
|
||||||
|
|
||||||
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
|
$filterdate = dol_mktime(0, 0, 0, GETPOST('fdmonth'), GETPOST('fdday'), GETPOST('fdyear'));
|
||||||
$filteraccountid = GETPOST('accountid', 'int');
|
$filteraccountid = GETPOST('accountid', 'int');
|
||||||
|
|
||||||
$object = new RemiseCheque($db);
|
// Security check
|
||||||
|
$fieldname = (!empty($ref) ? 'ref' : 'rowid');
|
||||||
|
if ($user->socid) {
|
||||||
|
$socid = $user->socid;
|
||||||
|
}
|
||||||
|
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque', '', 'fk_user_author', $fieldname);
|
||||||
|
|
||||||
|
$usercanread = $user->rights->banque->cheque;
|
||||||
|
$usercancreate = $user->rights->banque->cheque;
|
||||||
|
$usercandelete = $user->rights->banque->cheque;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -241,7 +247,9 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
|
|||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|
||||||
$file = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'cheque').GETPOST('file');
|
$filetodelete = GETPOST('file', 'alpha');
|
||||||
|
$file = $upload_dir.'/'.$filetodelete;
|
||||||
|
|
||||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||||
if ($ret) {
|
if ($ret) {
|
||||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||||
@ -634,6 +642,12 @@ if ($action == 'new') {
|
|||||||
$i = 1;
|
$i = 1;
|
||||||
if ($num > 0) {
|
if ($num > 0) {
|
||||||
while ($objp = $db->fetch_object($resql)) {
|
while ($objp = $db->fetch_object($resql)) {
|
||||||
|
$paymentstatic->id = $objp->pid;
|
||||||
|
$paymentstatic->ref = $objp->pref;
|
||||||
|
|
||||||
|
$accountlinestatic->id = $objp->rowid;
|
||||||
|
$accountlinestatic->ref = $objp->ref;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="center">'.$i.'</td>';
|
print '<td class="center">'.$i.'</td>';
|
||||||
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
|
print '<td class="center">'.dol_print_date($db->jdate($objp->date), 'day').'</td>'; // Operation date
|
||||||
@ -643,8 +657,6 @@ if ($action == 'new') {
|
|||||||
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
|
print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
|
||||||
// Link to payment
|
// Link to payment
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$paymentstatic->id = $objp->pid;
|
|
||||||
$paymentstatic->ref = $objp->pref;
|
|
||||||
if ($paymentstatic->id) {
|
if ($paymentstatic->id) {
|
||||||
print $paymentstatic->getNomUrl(1);
|
print $paymentstatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
@ -653,8 +665,6 @@ if ($action == 'new') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
// Link to bank transaction
|
// Link to bank transaction
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
$accountlinestatic->id = $objp->rowid;
|
|
||||||
$accountlinestatic->ref = $objp->ref;
|
|
||||||
if ($accountlinestatic->id > 0) {
|
if ($accountlinestatic->id > 0) {
|
||||||
print $accountlinestatic->getNomUrl(1);
|
print $accountlinestatic->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
@ -664,10 +674,10 @@ if ($action == 'new') {
|
|||||||
// Action button
|
// Action button
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
if ($object->statut == 0) {
|
if ($object->statut == 0) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&lineid='.$objp->rowid.'">'.img_delete().'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&token='.newToken().'&lineid='.$objp->rowid.'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
if ($object->statut == 1 && $objp->statut != 2) {
|
if ($object->statut == 1 && $objp->statut != 2) {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reject_check&token='.newToken().'&lineid='.$objp->rowid.'">'.img_picto($langs->trans("RejectCheck"), 'disable').'</a>';
|
||||||
}
|
}
|
||||||
if ($objp->statut == 2) {
|
if ($objp->statut == 2) {
|
||||||
print ' '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
|
print ' '.img_picto($langs->trans('CheckRejected'), 'statut8').'</a>';
|
||||||
@ -723,11 +733,13 @@ print '</div>';
|
|||||||
|
|
||||||
if ($action != 'new') {
|
if ($action != 'new') {
|
||||||
if ($object->statut == 1) {
|
if ($object->statut == 1) {
|
||||||
$filename = dol_sanitizeFileName($object->ref);
|
// Documents
|
||||||
$filedir = $dir.get_exdir($object->ref, 0, 1, 0, $object, 'checkdeposits');
|
$objref = dol_sanitizeFileName($object->ref);
|
||||||
|
$filedir = $upload_dir.'/'.$objref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
$genallowed = $usercancreate;
|
||||||
print $formfile->showdocuments('remisecheque', $filename, $filedir, $urlsource, 1, 1);
|
$delallowed = $usercandelete;
|
||||||
|
print $formfile->showdocuments('remisecheque', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -615,6 +615,7 @@ class RemiseCheque extends CommonObject
|
|||||||
// We save charset_output to restore it because write_file can change it if needed for
|
// We save charset_output to restore it because write_file can change it if needed for
|
||||||
// output format that does not support UTF8.
|
// output format that does not support UTF8.
|
||||||
$sav_charseSupprimert_output = $outputlangs->charset_output;
|
$sav_charseSupprimert_output = $outputlangs->charset_output;
|
||||||
|
|
||||||
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
|
$result = $docmodel->write_file($this, $conf->bank->dir_output.'/checkdeposits', $this->ref, $outputlangs);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
//$outputlangs->charset_output=$sav_charset_output;
|
//$outputlangs->charset_output=$sav_charset_output;
|
||||||
|
|||||||
@ -1580,16 +1580,19 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
foreach ($toselect as $toselectid) {
|
foreach ($toselect as $toselectid) {
|
||||||
$result = $objecttmp->fetch($toselectid);
|
$result = $objecttmp->fetch($toselectid);
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
if ($objecttmp->statut == Holiday::STATUS_VALIDATED && $user->id == $objecttmp->fk_validator) {
|
if ($objecttmp->statut != Holiday::STATUS_VALIDATED) {
|
||||||
|
setEventMessages($langs->trans('StatusOfRefMustBe', $objecttmp->ref, $langs->transnoentitiesnoconv('Validated')), null, 'warnings');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($user->id == $objecttmp->fk_validator) {
|
||||||
$objecttmp->oldcopy = dol_clone($objecttmp);
|
$objecttmp->oldcopy = dol_clone($objecttmp);
|
||||||
|
|
||||||
$objecttmp->date_valid = dol_now();
|
$objecttmp->date_valid = dol_now();
|
||||||
$objecttmp->fk_user_valid = $user->id;
|
$objecttmp->fk_user_valid = $user->id;
|
||||||
$objecttmp->statut = Holiday::STATUS_APPROVED;
|
$objecttmp->statut = Holiday::STATUS_APPROVED;
|
||||||
|
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
$verif = $objecttmp->approve($user);
|
$verif = $objecttmp->approve($user);
|
||||||
|
|
||||||
if ($verif <= 0) {
|
if ($verif <= 0) {
|
||||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -1664,14 +1667,9 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
|
||||||
$db->commit();
|
|
||||||
$nbok++;
|
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$langs->load("errors");
|
||||||
$action = '';
|
setEventMessages($langs->trans('ErrorNotApproverForHoliday', $objecttmp->ref), null, 'errors');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||||
@ -1683,7 +1681,7 @@ if (!$error && ($massaction == 'approveleave' || ($action == 'approveleave' && $
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
if ($nbok > 1) {
|
if ($nbok > 1) {
|
||||||
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
|
setEventMessages($langs->trans("RecordsApproved", $nbok), null, 'mesgs');
|
||||||
} else {
|
} elseif ($nbok == 1) {
|
||||||
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
|
setEventMessages($langs->trans("RecordAproved"), null, 'mesgs');
|
||||||
}
|
}
|
||||||
$db->commit();
|
$db->commit();
|
||||||
|
|||||||
@ -5131,7 +5131,7 @@ class Form
|
|||||||
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
$formconfirm .= '<td class="valid">'.$question.'</td>';
|
||||||
$formconfirm .= '<td class="valid center">';
|
$formconfirm .= '<td class="valid center">';
|
||||||
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
|
||||||
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'">';
|
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton small" type="submit" value="'.$langs->trans("Validate").'">';
|
||||||
$formconfirm .= '</td>';
|
$formconfirm .= '</td>';
|
||||||
$formconfirm .= '</tr>'."\n";
|
$formconfirm .= '</tr>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -360,8 +360,8 @@ class FormFile
|
|||||||
* This also set the property $this->numoffiles
|
* This also set the property $this->numoffiles
|
||||||
*
|
*
|
||||||
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
|
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule:MyObject', 'mymodule_temp', ...)
|
||||||
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into subdir of module.
|
* @param string $modulesubdir Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if file is not into a subdir of module.
|
||||||
* @param string $filedir Directory to scan
|
* @param string $filedir Directory to scan (must not end with a /). Example: '/mydolibarrdocuments/facture/FAYYMM-1234'
|
||||||
* @param string $urlsource Url of origin page (for return)
|
* @param string $urlsource Url of origin page (for return)
|
||||||
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
|
* @param int|string[] $genallowed Generation is allowed (1/0 or array list of templates)
|
||||||
* @param int $delallowed Remove is allowed (1/0)
|
* @param int $delallowed Remove is allowed (1/0)
|
||||||
|
|||||||
@ -126,8 +126,7 @@ abstract class ModeleNumRefChequeReceipts
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \class ModeleChequeReceipts
|
* Class parent for templates of document generation
|
||||||
* \brief Classe mere des modeles de
|
|
||||||
*/
|
*/
|
||||||
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
abstract class ModeleChequeReceipts extends CommonDocGenerator
|
||||||
{
|
{
|
||||||
|
|||||||
@ -212,14 +212,14 @@ if ($massaction == 'presend') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($massaction == 'preenable') {
|
if ($massaction == 'preenable') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassEnabling"), $langs->trans("ConfirmMassEnablingQuestion", count($toselect)), "enable", null, 'yes', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
if ($massaction == 'predisable') {
|
if ($massaction == 'predisable') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDisabling"), $langs->trans("ConfirmMassDisablingQuestion", count($toselect)), "disable", null, '', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($massaction == 'preapproveleave') {
|
if ($massaction == 'preapproveleave') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, '', 0, 200, 500, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassLeaveApproval"), $langs->trans("ConfirmMassLeaveApprovalQuestion", count($toselect)), "approveleave", null, 'yes', 0, 200, 500, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
||||||
|
|||||||
@ -327,7 +327,11 @@ class EcmFiles extends CommonObject
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql) {
|
if (!$resql) {
|
||||||
$error++;
|
$error++;
|
||||||
|
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||||
|
$this->errors[] = 'Error DB_ERROR_RECORD_ALREADY_EXISTS : '.$this->db->lasterror();
|
||||||
|
} else {
|
||||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||||
|
}
|
||||||
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -245,7 +245,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
public $multicurrency_total_ht;
|
public $multicurrency_total_ht;
|
||||||
public $multicurrency_total_tva;
|
public $multicurrency_total_tva;
|
||||||
public $multicurrency_total_ttc;
|
public $multicurrency_total_ttc;
|
||||||
//! id of source var_dump($$this);invoice if replacement invoice or credit note
|
//! id of source invoice if replacement invoice or credit note
|
||||||
/**
|
/**
|
||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1083,7 +1083,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||||||
if (empty($include_users)) {
|
if (empty($include_users)) {
|
||||||
print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
|
print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays");
|
||||||
} else {
|
} else {
|
||||||
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator); // Will work only if supervisor has permission to approve so is inside include_users
|
// Defined default approver (the forced approved of user or the supervisor if no forced value defined)
|
||||||
|
// Note: This use will be set only if the deinfed approvr has permission to approve so is inside include_users
|
||||||
|
$defaultselectuser = (empty($user->fk_user_holiday_validator) ? $user->fk_user : $user->fk_user_holiday_validator);
|
||||||
if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
|
if (!empty($conf->global->HOLIDAY_DEFAULT_VALIDATOR)) {
|
||||||
$defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
|
$defaultselectuser = $conf->global->HOLIDAY_DEFAULT_VALIDATOR; // Can force default approver
|
||||||
}
|
}
|
||||||
|
|||||||
@ -278,6 +278,7 @@ ErrorIsNotADraft=%s is not a draft
|
|||||||
ErrorExecIdFailed=Can't execute command "id"
|
ErrorExecIdFailed=Can't execute command "id"
|
||||||
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
ErrorBadCharIntoLoginName=Unauthorized character in the login name
|
||||||
ErrorRequestTooLarge=Error, request too large
|
ErrorRequestTooLarge=Error, request too large
|
||||||
|
ErrorNotApproverForHoliday=You are not the approver for leave %s
|
||||||
|
|
||||||
# Warnings
|
# Warnings
|
||||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||||
|
|||||||
@ -432,7 +432,7 @@ class modMyModule extends DolibarrModules
|
|||||||
$sql = array();
|
$sql = array();
|
||||||
|
|
||||||
// Document templates
|
// Document templates
|
||||||
$moduledir = 'mymodule';
|
$moduledir = dol_sanitizeFileName('mymodule');
|
||||||
$myTmpObjects = array();
|
$myTmpObjects = array();
|
||||||
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
|
||||||
|
|
||||||
@ -441,8 +441,8 @@ class modMyModule extends DolibarrModules
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($myTmpObjectArray['includerefgeneration']) {
|
if ($myTmpObjectArray['includerefgeneration']) {
|
||||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_myobjects.odt';
|
||||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
|
||||||
$dest = $dirodt.'/template_myobjects.odt';
|
$dest = $dirodt.'/template_myobjects.odt';
|
||||||
|
|
||||||
if (file_exists($src) && !file_exists($dest)) {
|
if (file_exists($src) && !file_exists($dest)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user