Merge remote-tracking branch 'upstream/7.0' into 7.0
This commit is contained in:
commit
81bf7d07e3
@ -108,9 +108,7 @@ elseif ($action == 'update_currency')
|
|||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$submit = GETPOST('submit', 'alpha');
|
if (GETPOST('updatecurrency', 'alpha'))
|
||||||
|
|
||||||
if ($submit == $langs->trans('Modify'))
|
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$rate = price2num(GETPOST('rate', 'alpha'));
|
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||||
@ -129,7 +127,7 @@ elseif ($action == 'update_currency')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($submit == $langs->trans('Delete'))
|
elseif (GETPOST('deletecurrency', 'alpha'))
|
||||||
{
|
{
|
||||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||||
$currency = new MultiCurrency($db);
|
$currency = new MultiCurrency($db);
|
||||||
@ -357,8 +355,8 @@ foreach ($TCurrency as &$currency)
|
|||||||
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
||||||
print '1 '.$conf->currency.' = ';
|
print '1 '.$conf->currency.' = ';
|
||||||
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" /> '.$currency->code.' ';
|
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" /> '.$currency->code.' ';
|
||||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Modify").'"> ';
|
print '<input type="submit" name="updatecurrency" class="button" value="'.$langs->trans("Modify").'"> ';
|
||||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Delete").'">';
|
print '<input type="submit" name="deletecurrency" class="button" value="'.$langs->trans("Delete").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@ -1001,6 +1001,11 @@ if (! empty($hookmanager->resArray['eventarray'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort events
|
||||||
|
foreach($eventarray as $keyDate => &$dateeventarray)
|
||||||
|
{
|
||||||
|
usort($dateeventarray, 'sort_events_by_date');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$maxnbofchar=0;
|
$maxnbofchar=0;
|
||||||
@ -1630,3 +1635,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
|
|||||||
}
|
}
|
||||||
return $newcolor;
|
return $newcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort events by date
|
||||||
|
*
|
||||||
|
* @param object $a Event A
|
||||||
|
* @param object $b Event B
|
||||||
|
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
|
||||||
|
*/
|
||||||
|
function sort_events_by_date($a, $b)
|
||||||
|
{
|
||||||
|
if($a->datep != $b->datep)
|
||||||
|
{
|
||||||
|
return $a->datep - $b->datep;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If both events have the same start time, longest first
|
||||||
|
return $b->datef - $a->datef;
|
||||||
|
}
|
||||||
|
|||||||
@ -3314,7 +3314,7 @@ class Form
|
|||||||
if ($obj->situation_final != 1) {
|
if ($obj->situation_final != 1) {
|
||||||
//Not prov?
|
//Not prov?
|
||||||
if (substr($obj->facnumber, 1, 4) != 'PROV') {
|
if (substr($obj->facnumber, 1, 4) != 'PROV') {
|
||||||
if ($selected == $obj->situation_final) {
|
if ($selected == $obj->rowid) {
|
||||||
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
|
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
|
||||||
} else {
|
} else {
|
||||||
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
|
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
|
||||||
|
|||||||
@ -2344,14 +2344,11 @@ elseif (! empty($object->id))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create bill
|
// Create bill
|
||||||
if (! empty($conf->facture->enabled))
|
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
|
||||||
{
|
{
|
||||||
if (! empty($conf->fournisseur->enabled) && ($object->statut >= 2 && $object->statut != 7 && $object->billed != 1)) // statut 2 means approved, 7 means canceled
|
if ($user->rights->fournisseur->facture->creer)
|
||||||
{
|
{
|
||||||
if ($user->rights->fournisseur->facture->creer)
|
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user