forked from Wavyzz/dolibarr
FIX: Variable might not be traversable
This commit is contained in:
committed by
Raphaël Doursenaud
parent
f68cb3bfcb
commit
eea9a76589
@@ -170,83 +170,87 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
$links = $object->get_url($obj->rowid);
|
$links = $object->get_url($obj->rowid);
|
||||||
|
|
||||||
foreach ( $links as $key => $val ) {
|
// get_url may return -1 which is not traversable
|
||||||
|
if (is_array($links)) {
|
||||||
|
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
foreach ( $links as $key => $val ) {
|
||||||
|
|
||||||
if ($links[$key]['type'] == 'payment')
|
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||||
{
|
|
||||||
$paymentstatic->id = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
|
||||||
}
|
|
||||||
else if ($links[$key]['type'] == 'payment_supplier')
|
|
||||||
{
|
|
||||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
|
||||||
}
|
|
||||||
else if ($links[$key]['type'] == 'company')
|
|
||||||
{
|
|
||||||
$societestatic->id = $links[$key]['url_id'];
|
|
||||||
$societestatic->nom = $links[$key]['label'];
|
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
|
||||||
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
|
||||||
}
|
|
||||||
else if ($links[$key]['type'] == 'sc')
|
|
||||||
{
|
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
|
||||||
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
if ($links[$key]['type'] == 'payment')
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
|
||||||
if ($reg[1] == 'socialcontribution')
|
|
||||||
$reg[1] = 'SocialContribution';
|
|
||||||
$chargestatic->lib = $langs->trans($reg[1]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$chargestatic->lib = $links[$key]['label'];
|
$paymentstatic->id = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
||||||
}
|
}
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
else if ($links[$key]['type'] == 'payment_supplier')
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
|
||||||
|
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
|
||||||
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid)
|
|
||||||
{
|
{
|
||||||
$objmid = $db->fetch_object($resultmid);
|
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||||
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
||||||
}
|
}
|
||||||
|
else if ($links[$key]['type'] == 'company')
|
||||||
|
{
|
||||||
|
$societestatic->id = $links[$key]['url_id'];
|
||||||
|
$societestatic->nom = $links[$key]['label'];
|
||||||
|
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||||
|
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type'] == 'sc')
|
||||||
|
{
|
||||||
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
|
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
||||||
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
|
if ($reg[1] == 'socialcontribution')
|
||||||
|
$reg[1] = 'SocialContribution';
|
||||||
|
$chargestatic->lib = $langs->trans($reg[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$chargestatic->lib = $links[$key]['label'];
|
||||||
|
}
|
||||||
|
$chargestatic->ref = $chargestatic->lib;
|
||||||
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
|
|
||||||
|
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||||
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
||||||
|
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
||||||
|
|
||||||
|
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
|
$resultmid = $db->query($sqlmid);
|
||||||
|
if ($resultmid)
|
||||||
|
{
|
||||||
|
$objmid = $db->fetch_object($resultmid);
|
||||||
|
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type'] == 'payment_vat')
|
||||||
|
{
|
||||||
|
$paymentvatstatic->id = $links[$key]['url_id'];
|
||||||
|
$paymentvatstatic->ref = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||||
|
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type'] == 'payment_salary')
|
||||||
|
{
|
||||||
|
$paymentsalstatic->id = $links[$key]['url_id'];
|
||||||
|
$paymentsalstatic->ref = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
||||||
|
$tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
|
||||||
|
}
|
||||||
|
else if ($links[$key]['type'] == 'banktransfert')
|
||||||
|
{
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||||
|
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
||||||
|
}
|
||||||
|
/*else {
|
||||||
|
$tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
else if ($links[$key]['type'] == 'payment_vat')
|
|
||||||
{
|
|
||||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
}
|
|
||||||
else if ($links[$key]['type'] == 'payment_salary')
|
|
||||||
{
|
|
||||||
$paymentsalstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentsalstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
|
|
||||||
}
|
|
||||||
else if ($links[$key]['type'] == 'banktransfert')
|
|
||||||
{
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
}
|
|
||||||
/*else {
|
|
||||||
$tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
||||||
|
|
||||||
|
|||||||
@@ -157,64 +157,67 @@ if ($result) {
|
|||||||
}
|
}
|
||||||
$links = $object->get_url($obj->rowid);
|
$links = $object->get_url($obj->rowid);
|
||||||
|
|
||||||
foreach ( $links as $key => $val ) {
|
// get_url may return -1 which is not traversable
|
||||||
|
if (is_array($links)) {
|
||||||
|
foreach ($links as $key => $val) {
|
||||||
|
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||||
|
|
||||||
if ($links[$key]['type'] == 'payment') {
|
if ($links[$key]['type'] == 'payment') {
|
||||||
$paymentstatic->id = $links[$key]['url_id'];
|
$paymentstatic->id = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2);
|
||||||
} else if ($links[$key]['type'] == 'payment_supplier') {
|
} else if ($links[$key]['type'] == 'payment_supplier') {
|
||||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||||
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
||||||
} else if ($links[$key]['type'] == 'company') {
|
} else if ($links[$key]['type'] == 'company') {
|
||||||
|
|
||||||
$societestatic->id = $links[$key]['url_id'];
|
$societestatic->id = $links[$key]['url_id'];
|
||||||
$societestatic->nom = $links[$key]['label'];
|
$societestatic->nom = $links[$key]['label'];
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||||
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
} else if ($links[$key]['type'] == 'sc') {
|
} else if ($links[$key]['type'] == 'sc') {
|
||||||
|
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $chargestatic->getNomUrl(2);
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
if ($reg[1] == 'socialcontribution')
|
if ($reg[1] == 'socialcontribution')
|
||||||
$reg[1] = 'SocialContribution';
|
$reg[1] = 'SocialContribution';
|
||||||
$chargestatic->lib = $langs->trans($reg[1]);
|
$chargestatic->lib = $langs->trans($reg[1]);
|
||||||
} else {
|
} else {
|
||||||
$chargestatic->lib = $links[$key]['label'];
|
$chargestatic->lib = $links[$key]['label'];
|
||||||
|
}
|
||||||
|
$chargestatic->ref = $chargestatic->lib;
|
||||||
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
|
|
||||||
|
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||||
|
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
||||||
|
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
||||||
|
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
||||||
|
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||||
|
$resultmid = $db->query($sqlmid);
|
||||||
|
if ($resultmid) {
|
||||||
|
$objmid = $db->fetch_object($resultmid);
|
||||||
|
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
||||||
|
}
|
||||||
|
} else if ($links[$key]['type'] == 'payment_vat') {
|
||||||
|
|
||||||
|
$paymentvatstatic->id = $links[$key]['url_id'];
|
||||||
|
$paymentvatstatic->ref = $links[$key]['url_id'];
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||||
|
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
||||||
|
} else if ($links[$key]['type'] == 'banktransfert') {
|
||||||
|
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||||
|
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
||||||
}
|
}
|
||||||
$chargestatic->ref = $chargestatic->lib;
|
/*else {
|
||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
$tabtp [$obj->rowid] [$cptsociale] += $obj->amount;
|
||||||
|
}*/
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
|
||||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales cchgsoc ";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "chargesociales as chgsoc ON chgsoc.fk_type=cchgsoc.id";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementcharge as paycharg ON paycharg.fk_charge=chgsoc.rowid";
|
|
||||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "bank_url as bkurl ON bkurl.url_id=paycharg.rowid";
|
|
||||||
$sqlmid .= " WHERE bkurl.fk_bank=" . $obj->rowid;
|
|
||||||
dol_syslog("accountancy/journal/cashjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
|
||||||
$resultmid = $db->query($sqlmid);
|
|
||||||
if ($resultmid) {
|
|
||||||
$objmid = $db->fetch_object($resultmid);
|
|
||||||
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
|
||||||
}
|
|
||||||
} else if ($links[$key]['type'] == 'payment_vat') {
|
|
||||||
|
|
||||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
|
||||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
|
||||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
|
||||||
$tabtp[$obj->rowid][$cpttva] += $obj->amount;
|
|
||||||
}
|
}
|
||||||
/*else {
|
|
||||||
$tabtp [$obj->rowid] [$cptsociale] += $obj->amount;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
||||||
|
|
||||||
|
|||||||
@@ -600,41 +600,56 @@ else
|
|||||||
// Loop on each user to show calendar
|
// Loop on each user to show calendar
|
||||||
$sav = $tmpday;
|
$sav = $tmpday;
|
||||||
$showheader = true;
|
$showheader = true;
|
||||||
foreach ($usernames as $username)
|
|
||||||
{
|
|
||||||
echo "<tr>";
|
|
||||||
echo '<td class="cal_current_month">' . $username->getNomUrl(1). '</td>';
|
|
||||||
$tmpday = $sav;
|
|
||||||
|
|
||||||
$i = 0;
|
// listUsersForGroup may return -1 which is not traversable
|
||||||
for ($iter_day = 0; $iter_day < 7; $iter_day++)
|
if (is_array($usernames)) {
|
||||||
{
|
foreach ($usernames as $username) {
|
||||||
if (($i + 1) < $begin_d || ($i + 1) > $end_d)
|
echo "<tr>";
|
||||||
{
|
echo '<td class="cal_current_month">' . $username->getNomUrl(1) . '</td>';
|
||||||
|
$tmpday = $sav;
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
for ($iter_day = 0; $iter_day < 7; $iter_day++) {
|
||||||
|
if (($i + 1) < $begin_d || ($i + 1) > $end_d) {
|
||||||
|
$i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show days of the current week
|
||||||
|
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
|
||||||
|
$tmparray = dol_getdate($curtime, 'fast');
|
||||||
|
$tmpday = $tmparray['mday'];
|
||||||
|
$tmpmonth = $tmparray['mon'];
|
||||||
|
$tmpyear = $tmparray['year'];
|
||||||
|
|
||||||
|
$style = 'cal_current_month';
|
||||||
|
if ($iter_day == 6) $style .= ' cal_other_month';
|
||||||
|
$today = 0;
|
||||||
|
$todayarray = dol_getdate($now, 'fast');
|
||||||
|
if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $month && $todayarray['year'] == $year) $today = 1;
|
||||||
|
if ($today) $style = 'cal_today_peruser';
|
||||||
|
|
||||||
|
show_day_events2(
|
||||||
|
$username,
|
||||||
|
$tmpday,
|
||||||
|
$month,
|
||||||
|
$year,
|
||||||
|
$monthshown,
|
||||||
|
$style,
|
||||||
|
$eventarray,
|
||||||
|
0,
|
||||||
|
$maxnbofchar,
|
||||||
|
$newparam,
|
||||||
|
1,
|
||||||
|
300,
|
||||||
|
$showheader
|
||||||
|
);
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
echo "</tr>\n";
|
||||||
// Show days of the current week
|
$showheader = false;
|
||||||
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
|
|
||||||
$tmparray = dol_getdate($curtime,'fast');
|
|
||||||
$tmpday = $tmparray['mday'];
|
|
||||||
$tmpmonth = $tmparray['mon'];
|
|
||||||
$tmpyear = $tmparray['year'];
|
|
||||||
|
|
||||||
$style='cal_current_month';
|
|
||||||
if ($iter_day == 6) $style.=' cal_other_month';
|
|
||||||
$today=0;
|
|
||||||
$todayarray=dol_getdate($now,'fast');
|
|
||||||
if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
|
|
||||||
if ($today) $style='cal_today_peruser';
|
|
||||||
|
|
||||||
show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader);
|
|
||||||
|
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
echo "</tr>\n";
|
|
||||||
$showheader = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
|||||||
@@ -164,10 +164,10 @@ class Account extends CommonObject
|
|||||||
* TODO Move this into AccountLine
|
* TODO Move this into AccountLine
|
||||||
* Return array with links from llx_bank_url
|
* Return array with links from llx_bank_url
|
||||||
*
|
*
|
||||||
* @param int $fk_bank To search using bank transaction id
|
* @param int $fk_bank To search using bank transaction id
|
||||||
* @param int $url_id To search using link to
|
* @param int $url_id To search using link to
|
||||||
* @param string $type To search using type
|
* @param string $type To search using type
|
||||||
* @return array Array of links
|
* @return array|-1 Array of links or -1 on error
|
||||||
*/
|
*/
|
||||||
function get_url($fk_bank='', $url_id='', $type='')
|
function get_url($fk_bank='', $url_id='', $type='')
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1302,14 +1302,17 @@ class Form
|
|||||||
$assignedtouser=array();
|
$assignedtouser=array();
|
||||||
if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
|
if (!empty($_SESSION['assignedtouser'])) $assignedtouser=dol_json_decode($_SESSION['assignedtouser'], true);
|
||||||
if (count($assignedtouser)) $out.='<br>';
|
if (count($assignedtouser)) $out.='<br>';
|
||||||
foreach($assignedtouser as $key => $value)
|
// dol_json_decode may return false on error which is not traversable
|
||||||
{
|
if (is_array($assignedtouser)) {
|
||||||
$userstatic->fetch($key);
|
foreach($assignedtouser as $key => $value)
|
||||||
$out.=$userstatic->getNomUrl(1);
|
{
|
||||||
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
|
$userstatic->fetch($key);
|
||||||
//$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
|
$out.=$userstatic->getNomUrl(1);
|
||||||
$out.='<br>';
|
//$out.=' '.($value['mandatory']?$langs->trans("Mandatory"):$langs->trans("Optional"));
|
||||||
}
|
//$out.=' '.($value['transparency']?$langs->trans("Busy"):$langs->trans("NotBusy"));
|
||||||
|
$out.='<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//$out.='</form>';
|
//$out.='</form>';
|
||||||
return $out;
|
return $out;
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ if (! function_exists('json_decode'))
|
|||||||
*
|
*
|
||||||
* @param string $json Json encoded to PHP Object or Array
|
* @param string $json Json encoded to PHP Object or Array
|
||||||
* @param bool $assoc False return an object, true return an array. Try to always use it with true !
|
* @param bool $assoc False return an object, true return an array. Try to always use it with true !
|
||||||
* @return mixed Object or Array
|
* @return mixed Object or Array or false on error
|
||||||
*/
|
*/
|
||||||
function dol_json_decode($json, $assoc=false)
|
function dol_json_decode($json, $assoc=false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class UserGroup extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param string $excludefilter Filter to exclude
|
* @param string $excludefilter Filter to exclude
|
||||||
* @param int $mode 0=Return array of user instance, 1=Return array of users id only
|
* @param int $mode 0=Return array of user instance, 1=Return array of users id only
|
||||||
* @return array Array of users
|
* @return array|-1 Array of users or -1 on error
|
||||||
*/
|
*/
|
||||||
function listUsersForGroup($excludefilter='', $mode=0)
|
function listUsersForGroup($excludefilter='', $mode=0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user