Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0
Conflicts: htdocs/core/lib/security.lib.php htdocs/holiday/card.php htdocs/user/card.php
This commit is contained in:
commit
3ac268c200
@ -1038,8 +1038,8 @@ if ($resql) {
|
||||
$event->type = 'holiday';
|
||||
$event->type_picto = 'holiday';
|
||||
|
||||
$event->datep = $db->jdate($obj->date_start);
|
||||
$event->datef = $db->jdate($obj->date_end);
|
||||
$event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
|
||||
$event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
|
||||
$event->date_start_in_calendar = $event->datep;
|
||||
$event->date_end_in_calendar = $event->datef;
|
||||
|
||||
|
||||
@ -45,8 +45,14 @@ if ($mode == 'customer' && !$user->rights->commande->lire) {
|
||||
if ($mode == 'supplier' && empty($user->rights->fournisseur->commande->lire)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($mode == 'supplier') {
|
||||
$object_status = GETPOST('object_status', 'array:int');
|
||||
$object_status = implode(',', $object_status);
|
||||
} else {
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
}
|
||||
|
||||
|
||||
$object_status = GETPOST('object_status', 'intcomma');
|
||||
$typent_id = GETPOST('typent_id', 'int');
|
||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||
|
||||
|
||||
@ -807,6 +807,10 @@ class Facture extends CommonInvoice
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
|
||||
// Complete vat rate with code
|
||||
$vatrate = $newinvoiceline->tva_tx;
|
||||
if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')';
|
||||
|
||||
$newinvoiceline->fk_parent_line = $fk_parent_line;
|
||||
|
||||
if ($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except) {
|
||||
@ -817,7 +821,37 @@ class Facture extends CommonInvoice
|
||||
$newinvoiceline->fk_remise_except = $discountId;
|
||||
}
|
||||
|
||||
$result = $newinvoiceline->insert();
|
||||
$result = $this->addline(
|
||||
$newinvoiceline->desc,
|
||||
$newinvoiceline->subprice,
|
||||
$newinvoiceline->qty,
|
||||
$vatrate,
|
||||
$newinvoiceline->localtax1_tx,
|
||||
$newinvoiceline->localtax2_tx,
|
||||
$newinvoiceline->fk_product,
|
||||
$newinvoiceline->remise_percent,
|
||||
$newinvoiceline->date_start,
|
||||
$newinvoiceline->date_end,
|
||||
$newinvoiceline->fk_code_ventilation,
|
||||
$newinvoiceline->info_bits,
|
||||
$newinvoiceline->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$newinvoiceline->product_type,
|
||||
$newinvoiceline->rang,
|
||||
$newinvoiceline->special_code,
|
||||
$newinvoiceline->element,
|
||||
$newinvoiceline->id,
|
||||
$fk_parent_line,
|
||||
$newinvoiceline->fk_fournprice,
|
||||
$newinvoiceline->pa_ht,
|
||||
$newinvoiceline->label,
|
||||
$newinvoiceline->array_options,
|
||||
$newinvoiceline->situation_percent,
|
||||
$newinvoiceline->fk_prev_id,
|
||||
$newinvoiceline->fk_unit,
|
||||
$newinvoiceline->multicurrency_subprice
|
||||
);
|
||||
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0 && $newinvoiceline->product_type == 9) {
|
||||
|
||||
@ -119,7 +119,7 @@ class box_birthdays extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears')
|
||||
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
||||
);
|
||||
|
||||
/*$this->info_box_contents[$line][] = array(
|
||||
|
||||
@ -4882,18 +4882,18 @@ abstract class CommonObject
|
||||
global $langs, $hookmanager, $conf, $form, $action;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print '<td>'.$langs->trans('Description').'</td>';
|
||||
print '<td class="right">'.$langs->trans('VATRate').'</td>';
|
||||
print '<td class="right">'.$langs->trans('PriceUHT').'</td>';
|
||||
print '<td class="linecolref">'.$langs->trans('Ref').'</td>';
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description').'</td>';
|
||||
print '<td class="linecolvat right">'.$langs->trans('VATRate').'</td>';
|
||||
print '<td class="linecoluht right">'.$langs->trans('PriceUHT').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="right">'.$langs->trans('PriceUHTCurrency').'</td>';
|
||||
print '<td class="linecoluht_currency right">'.$langs->trans('PriceUHTCurrency').'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans('Qty').'</td>';
|
||||
print '<td class="linecolqty right">'.$langs->trans('Qty').'</td>';
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
print '<td class="left">'.$langs->trans('Unit').'</td>';
|
||||
print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>';
|
||||
}
|
||||
print '<td class="right">'.$langs->trans('ReductionShort').'</td>';
|
||||
print '<td class="linecoldiscount right">'.$langs->trans('ReductionShort').'</td>';
|
||||
print '<td class="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
|
||||
print '</tr>';
|
||||
$i = 0;
|
||||
|
||||
@ -678,7 +678,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
||||
$checkonentitydone = 0;
|
||||
|
||||
// Array to define rules of checks to do
|
||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website'); // Test on entity only (Objects with no link to company)
|
||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment'); // Test on entity only (Objects with no link to company)
|
||||
$checksoc = array('societe'); // Test for societe object
|
||||
$checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
||||
$checkproject = array('projet', 'project'); // Test for project object
|
||||
|
||||
@ -26,21 +26,21 @@ if (empty($conf) || !is_object($conf)) {
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
||||
<?php
|
||||
print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
|
||||
print '<td>'.$this->tpl['label'].'</td>';
|
||||
print '<td>'.$this->tpl['description'].'</td>';
|
||||
print '<td class="right">'.$this->tpl['vat_rate'].'</td>';
|
||||
print '<td class="right">'.$this->tpl['price'].'</td>';
|
||||
print '<tr data-id="'.$this->tpl['id'].'" class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
|
||||
print '<td class="linecolref">'.$this->tpl['label'].'</td>';
|
||||
print '<td class="linecoldescription">'.$this->tpl['description'].'</td>';
|
||||
print '<td class="linecolvat right">'.$this->tpl['vat_rate'].'</td>';
|
||||
print '<td class="linecoluht right">'.$this->tpl['price'].'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
print '<td class="right">'.$this->tpl['multicurrency_price'].'</td>';
|
||||
print '<td class="linecoluht_currency right">'.$this->tpl['multicurrency_price'].'</td>';
|
||||
}
|
||||
|
||||
print '<td class="right">'.$this->tpl['qty'].'</td>';
|
||||
print '<td class="linecolqty right">'.$this->tpl['qty'].'</td>';
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
|
||||
print '<td class="left">'.$langs->trans($this->tpl['unit']).'</td>';
|
||||
print '<td class="linecoluseunit left">'.$langs->trans($this->tpl['unit']).'</td>';
|
||||
}
|
||||
|
||||
print '<td class="right">'.$this->tpl['remise_percent'].'</td>';
|
||||
print '<td class="linecoldiscount right">'.$this->tpl['remise_percent'].'</td>';
|
||||
|
||||
$selected = 1;
|
||||
if (!empty($selectedLines) && !in_array($this->tpl['id'], $selectedLines)) {
|
||||
|
||||
@ -471,10 +471,9 @@ if (empty($reshook)) {
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysToValidate");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysToValidateBody")."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysToValidateBody")."</p>\n";
|
||||
|
||||
|
||||
// option to warn the validator in case of too short delay
|
||||
@ -484,8 +483,7 @@ if (empty($reshook)) {
|
||||
$nowplusdelay = dol_time_plus_duree($now, $delayForRequest, 'd');
|
||||
|
||||
if ($object->date_debut < $nowplusdelay) {
|
||||
$message .= "\n";
|
||||
$message .= $langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."\n";
|
||||
$message = "<p>".$langs->transnoentities("HolidaysToValidateDelay", $delayForRequest)."</p>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -495,20 +493,21 @@ if (empty($reshook)) {
|
||||
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);
|
||||
|
||||
if ($nbopenedday > $object->getCPforUser($object->fk_user, $object->fk_type)) {
|
||||
$message .= "\n";
|
||||
$message .= $langs->transnoentities("HolidaysToValidateAlertSolde")."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysToValidateAlertSolde")."</p>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$message .= "\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$link = dol_buildpath("/holiday/card.php", 3) . '?id='.$object->id;
|
||||
|
||||
$message .= "<ul>";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Name")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Period")." : ".dol_print_date($object->date_debut, 'day')." ".$langs->transnoentitiesnoconv("To")." ".dol_print_date($object->date_fin, 'day')."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Sending the email
|
||||
$result = $mail->sendfile();
|
||||
@ -617,19 +616,20 @@ if (empty($reshook)) {
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysValidated");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."</p>\n";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// Sending email
|
||||
$result = $mail->sendfile();
|
||||
@ -697,20 +697,21 @@ if (empty($reshook)) {
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysRefused");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= GETPOST('detail_refuse', 'alpha')."\n\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."<p>\n";
|
||||
$message .= "<p>".GETPOST('detail_refuse', 'alpha')."</p>";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// sending email
|
||||
$result = $mail->sendfile();
|
||||
@ -842,18 +843,20 @@ if (empty($reshook)) {
|
||||
$subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysCanceled");
|
||||
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
$message = "<p>".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",</p>\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
$message .= "<p>".$langs->transnoentities("HolidaysCanceledBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."</p>\n";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("Link")." : ".$dolibarr_main_url_root."/holiday/card.php?id=".$object->id."\n\n";
|
||||
$message .= "\n";
|
||||
$link = dol_buildpath('/holiday/card.php', 3).'?id='.$object->id;
|
||||
|
||||
$message .= "<ul>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("ModifiedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."</li>\n";
|
||||
$message .= "<li>".$langs->transnoentitiesnoconv("Link").' : <a href="'.$link.'" target="_blank">'.$link."</a></li>\n";
|
||||
$message .= "</ul>\n";
|
||||
|
||||
$trackid = 'leav'.$object->id;
|
||||
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 0, '', '', $trackid);
|
||||
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
|
||||
|
||||
// sending email
|
||||
$result = $mail->sendfile();
|
||||
|
||||
@ -249,6 +249,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -198,6 +198,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -183,7 +183,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -214,6 +214,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER ['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -197,6 +197,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -176,6 +176,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -199,6 +199,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -198,6 +198,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
|
||||
print '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$product->id.'" name="search_form">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
if (!empty($sortfield)) {
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'"/>';
|
||||
}
|
||||
|
||||
@ -909,10 +909,10 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
}
|
||||
|
||||
// Desired stock
|
||||
print '<td class="right">'.($fk_entrepot > 0 ? $desiredstockwarehouse : $desiredstock).'</td>';
|
||||
print '<td class="right">'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $desiredstockwarehouse : $desiredstock).'</td>';
|
||||
|
||||
// Limit stock for alert
|
||||
print '<td class="right">'.($fk_entrepot > 0 ? $alertstockwarehouse : $alertstock).'</td>';
|
||||
print '<td class="right">'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $alertstockwarehouse : $alertstock).'</td>';
|
||||
|
||||
// Current stock (all warehouses)
|
||||
print '<td class="right">'.$warning.$stock;
|
||||
@ -928,7 +928,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
print '<td class="right"><a href="replenishorders.php?search_product='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';
|
||||
|
||||
// To order
|
||||
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.($fk_entrepot > 0 ? $stocktobuywarehouse : $stocktobuy).'"></td>';
|
||||
print '<td class="right"><input type="text" size="4" name="tobuy'.$i.'" value="'.((!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy).'"></td>';
|
||||
|
||||
// Supplier
|
||||
print '<td class="right">';
|
||||
|
||||
@ -1271,7 +1271,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
// Date birth
|
||||
print '<tr><td>'.$langs->trans("DateOfBirth").'</td>';
|
||||
print '<td>';
|
||||
print $form->selectDate($dateofbirth, 'dateofbirth', 0, 0, 1, 'createuser', 1, 0);
|
||||
print $form->selectDate($dateofbirth, 'dateofbirth', 0, 0, 1, 'createuser', 1, 0, 0, '', 0, '', '', 1, '', '', 'tzserver');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1562,6 +1562,13 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Date of birth
|
||||
print '<tr><td>'.$langs->trans("DateOfBirth").'</td>';
|
||||
print '<td>';
|
||||
print dol_print_date($object->birth, 'day', 'tzserver');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Default warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE_USER)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
@ -1839,14 +1846,14 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DisabledInMonoUserMode")).'">'.$langs->trans("Modify").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
} elseif ($caneditpassword && !$object->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
(empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("EditPassword").'</a></div>';
|
||||
}
|
||||
|
||||
@ -1855,16 +1862,16 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
if ($object->statut == 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
} elseif ($caneditpassword && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=password&token='.newToken().'">'.$langs->trans("ReinitPassword").'</a></div>';
|
||||
}
|
||||
|
||||
if ($object->statut == 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("UserDisabled")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
} elseif ($caneditpassword && $object->login && !$object->ldap_sid &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
if ($object->email) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=passwordsend&token='.newToken().'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a></div>';
|
||||
}
|
||||
@ -1873,12 +1880,12 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
|
||||
// Enable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Reactivate").'</a></div>';
|
||||
}
|
||||
// Disable user
|
||||
if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("DisableUser").'</a></div>';
|
||||
} else {
|
||||
if ($user->id == $id) {
|
||||
@ -1887,7 +1894,7 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
}
|
||||
// Delete
|
||||
if ($user->id <> $id && $candisableuser &&
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) {
|
||||
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $object->entity == 1))) {
|
||||
if ($user->admin || !$object->admin) { // If user edited is admin, delete is possible on for an admin
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&id='.$object->id.'">'.$langs->trans("DeleteUser").'</a></div>';
|
||||
} else {
|
||||
@ -2722,9 +2729,9 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
print '<tr><td>'.$langs->trans("DateOfBirth").'</td>';
|
||||
print '<td>';
|
||||
if ($caneditfield) {
|
||||
echo $form->selectDate($dateofbirth ? $dateofbirth : $object->birth, 'dateofbirth', 0, 0, 1, 'updateuser', 1, 0);
|
||||
echo $form->selectDate($dateofbirth ? $dateofbirth : $object->birth, 'dateofbirth', 0, 0, 1, 'updateuser', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
|
||||
} else {
|
||||
print dol_print_date($object->birth, 'day');
|
||||
print dol_print_date($object->birth, 'day', 'tzserver');
|
||||
}
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1847,7 +1847,7 @@ class User extends CommonObject
|
||||
$sql .= ", login = '".$this->db->escape($this->login)."'";
|
||||
$sql .= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null");
|
||||
$sql .= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
|
||||
$sql .= ", birth=".(strval($this->birth) != '' ? "'".$this->db->idate($this->birth)."'" : 'null');
|
||||
$sql .= ", birth=".(strval($this->birth) != '' ? "'".$this->db->idate($this->birth, 'tzserver')."'" : 'null');
|
||||
if (!empty($user->admin)) {
|
||||
$sql .= ", admin = ".(int) $this->admin; // admin flag can be set/unset only by an admin user
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user