Fix missing count of nb of columns into lists
This commit is contained in:
parent
3e51d2f537
commit
543630e487
@ -682,6 +682,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
@ -706,56 +707,67 @@ while ($i < min($num,$limit))
|
|||||||
print '<td valign="middle">';
|
print '<td valign="middle">';
|
||||||
print $contactstatic->getNomUrl(1,'',0);
|
print $contactstatic->getNomUrl(1,'',0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Firstname
|
// Firstname
|
||||||
if (! empty($arrayfields['p.firstname']['checked']))
|
if (! empty($arrayfields['p.firstname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->firstname.'</td>';
|
print '<td>'.$obj->firstname.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Zip
|
// Zip
|
||||||
if (! empty($arrayfields['p.zip']['checked']))
|
if (! empty($arrayfields['p.zip']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->zip.'</td>';
|
print '<td>'.$obj->zip.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Town
|
// Town
|
||||||
if (! empty($arrayfields['p.town']['checked']))
|
if (! empty($arrayfields['p.town']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->town.'</td>';
|
print '<td>'.$obj->town.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Function
|
// Function
|
||||||
if (! empty($arrayfields['p.poste']['checked']))
|
if (! empty($arrayfields['p.poste']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_trunc($obj->poste,20).'</td>';
|
print '<td>'.dol_trunc($obj->poste,20).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Phone
|
// Phone
|
||||||
if (! empty($arrayfields['p.phone']['checked']))
|
if (! empty($arrayfields['p.phone']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Phone perso
|
// Phone perso
|
||||||
if (! empty($arrayfields['p.phone_perso']['checked']))
|
if (! empty($arrayfields['p.phone_perso']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_print_phone($obj->phone_perso,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
print '<td>'.dol_print_phone($obj->phone_perso,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Phone mobile
|
// Phone mobile
|
||||||
if (! empty($arrayfields['p.phone_mobile']['checked']))
|
if (! empty($arrayfields['p.phone_mobile']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
print '<td>'.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Fax
|
// Fax
|
||||||
if (! empty($arrayfields['p.fax']['checked']))
|
if (! empty($arrayfields['p.fax']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// EMail
|
// EMail
|
||||||
if (! empty($arrayfields['p.email']['checked']))
|
if (! empty($arrayfields['p.email']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Skype
|
// Skype
|
||||||
if (! empty($arrayfields['p.skype']['checked']))
|
if (! empty($arrayfields['p.skype']['checked']))
|
||||||
{
|
{
|
||||||
if (! empty($conf->skype->enabled)) { print '<td>'.dol_print_skype($obj->skype,$obj->rowid,$obj->socid,'AC_SKYPE',18).'</td>'; }
|
if (! empty($conf->skype->enabled)) { print '<td>'.dol_print_skype($obj->skype,$obj->rowid,$obj->socid,'AC_SKYPE',18).'</td>'; }
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Company
|
// Company
|
||||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||||
@ -770,12 +782,14 @@ while ($i < min($num,$limit))
|
|||||||
else
|
else
|
||||||
print ' ';
|
print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private/Public
|
// Private/Public
|
||||||
if (! empty($arrayfields['p.priv']['checked']))
|
if (! empty($arrayfields['p.priv']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -792,6 +806,7 @@ while ($i < min($num,$limit))
|
|||||||
$tmpkey='options_'.$key;
|
$tmpkey='options_'.$key;
|
||||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -805,6 +820,7 @@ while ($i < min($num,$limit))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date modification
|
// Date modification
|
||||||
if (! empty($arrayfields['p.tms']['checked']))
|
if (! empty($arrayfields['p.tms']['checked']))
|
||||||
@ -812,11 +828,13 @@ while ($i < min($num,$limit))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['p.statut']['checked']))
|
if (! empty($arrayfields['p.statut']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">'.$contactstatic->getLibStatut(3).'</td>';
|
print '<td align="center">'.$contactstatic->getLibStatut(3).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
|
|||||||
@ -3692,7 +3692,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
|
|||||||
* @param float $amount Amount to format
|
* @param float $amount Amount to format
|
||||||
* @param integer $form Type of format, HTML or not (not by default)
|
* @param integer $form Type of format, HTML or not (not by default)
|
||||||
* @param Translate $outlangs Object langs for output
|
* @param Translate $outlangs Object langs for output
|
||||||
* @param int $trunc 1=Truncate if there is too much decimals (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless.
|
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless.
|
||||||
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
||||||
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||||
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
||||||
|
|||||||
@ -674,6 +674,7 @@ else
|
|||||||
$product_fourn =new ProductFournisseur($db);
|
$product_fourn =new ProductFournisseur($db);
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -721,6 +722,7 @@ else
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $product_static->getNomUrl(1,'',24);
|
print $product_static->getNomUrl(1,'',24);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
if (! empty($arrayfields['pfp.ref_fourn']['checked']))
|
if (! empty($arrayfields['pfp.ref_fourn']['checked']))
|
||||||
@ -728,24 +730,28 @@ else
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print $product_static->getNomUrl(1,'',24);
|
print $product_static->getNomUrl(1,'',24);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Label
|
// Label
|
||||||
if (! empty($arrayfields['p.label']['checked']))
|
if (! empty($arrayfields['p.label']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.dol_trunc($obj->label,40).'</td>';
|
print '<td>'.dol_trunc($obj->label,40).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
if (! empty($arrayfields['p.fk_product_type']['checked']))
|
if (! empty($arrayfields['p.fk_product_type']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->fk_product_type.'</td>';
|
print '<td>'.$obj->fk_product_type.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Barcode
|
// Barcode
|
||||||
if (! empty($arrayfields['p.barcode']['checked']))
|
if (! empty($arrayfields['p.barcode']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->barcode.'</td>';
|
print '<td>'.$obj->barcode.'</td>';
|
||||||
}
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Duration
|
// Duration
|
||||||
if (! empty($arrayfields['p.duration']['checked']))
|
if (! empty($arrayfields['p.duration']['checked']))
|
||||||
@ -761,6 +767,7 @@ else
|
|||||||
else print $obj->duration;
|
else print $obj->duration;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sell price
|
// Sell price
|
||||||
@ -773,6 +780,7 @@ else
|
|||||||
else print price($obj->price).' '.$langs->trans("HT");
|
else print price($obj->price).' '.$langs->trans("HT");
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Better buy price
|
// Better buy price
|
||||||
@ -796,6 +804,7 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Limit alert
|
// Limit alert
|
||||||
@ -807,6 +816,7 @@ else
|
|||||||
print $obj->seuil_stock_alerte;
|
print $obj->seuil_stock_alerte;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Desired stock
|
// Desired stock
|
||||||
if (! empty($arrayfields['p.desiredstock']['checked']))
|
if (! empty($arrayfields['p.desiredstock']['checked']))
|
||||||
@ -817,6 +827,7 @@ else
|
|||||||
print $obj->desiredstock;
|
print $obj->desiredstock;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Stock
|
// Stock
|
||||||
if (! empty($arrayfields['p.stock']['checked']))
|
if (! empty($arrayfields['p.stock']['checked']))
|
||||||
@ -828,7 +839,8 @@ else
|
|||||||
print $product_static->stock_reel;
|
print $product_static->stock_reel;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Stock
|
// Stock
|
||||||
if (! empty($arrayfields['stock_virtual']['checked']))
|
if (! empty($arrayfields['stock_virtual']['checked']))
|
||||||
{
|
{
|
||||||
@ -839,18 +851,28 @@ else
|
|||||||
print $product_static->stock_theorique;
|
print $product_static->stock_theorique;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Lot/Serial
|
// Lot/Serial
|
||||||
if (! empty($arrayfields['p.tobatch']['checked']))
|
if (! empty($arrayfields['p.tobatch']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print yn($obj->tobatch);
|
print yn($obj->tobatch);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Accountancy code sell
|
// Accountancy code sell
|
||||||
if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print '<td>'.$obj->accountancy_code_sell.'</td>';
|
if (! empty($arrayfields['p.accountancy_code_sell']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$obj->accountancy_code_sell.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Accountancy code sell
|
// Accountancy code sell
|
||||||
if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print '<td>'.$obj->accountancy_code_buy.'</td>';
|
if (! empty($arrayfields['p.accountancy_code_buy']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>'.$obj->accountancy_code_buy.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
{
|
{
|
||||||
@ -865,6 +887,7 @@ else
|
|||||||
$tmpkey='options_'.$key;
|
$tmpkey='options_'.$key;
|
||||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,6 +901,7 @@ else
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($obj->date_creation, 'dayhour');
|
print dol_print_date($obj->date_creation, 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date modification
|
// Date modification
|
||||||
if (! empty($arrayfields['p.tms']['checked']))
|
if (! empty($arrayfields['p.tms']['checked']))
|
||||||
@ -885,6 +909,7 @@ else
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($obj->date_update, 'dayhour');
|
print dol_print_date($obj->date_update, 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status (to sell)
|
// Status (to sell)
|
||||||
@ -897,6 +922,7 @@ else
|
|||||||
print $product_static->LibStatut($obj->tosell,5,0);
|
print $product_static->LibStatut($obj->tosell,5,0);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Status (to buy)
|
// Status (to buy)
|
||||||
if (! empty($arrayfields['p.tobuy']['checked']))
|
if (! empty($arrayfields['p.tobuy']['checked']))
|
||||||
@ -908,6 +934,7 @@ else
|
|||||||
print $product_static->LibStatut($obj->tobuy,5,1);
|
print $product_static->LibStatut($obj->tobuy,5,1);
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Action
|
// Action
|
||||||
print '<td class="nowrap" align="center">';
|
print '<td class="nowrap" align="center">';
|
||||||
@ -918,6 +945,7 @@ else
|
|||||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@ -41,6 +41,7 @@ $ref=GETPOST('ref','alpha');
|
|||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$backtopage=GETPOST('backtopage','alpha');
|
$backtopage=GETPOST('backtopage','alpha');
|
||||||
$cancel=GETPOST('cancel','alpha');
|
$cancel=GETPOST('cancel','alpha');
|
||||||
|
$confirm=GETPOST('confirm','aZ09');
|
||||||
$status=GETPOST('status','int');
|
$status=GETPOST('status','int');
|
||||||
$opp_status=GETPOST('opp_status','int');
|
$opp_status=GETPOST('opp_status','int');
|
||||||
$opp_percent=price2num(GETPOST('opp_percent','alpha'));
|
$opp_percent=price2num(GETPOST('opp_percent','alpha'));
|
||||||
@ -68,7 +69,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$socid=GETPOST('socid');
|
$socid=GETPOST('socid','int');
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
|
||||||
$result = restrictedArea($user, 'projet', $object->id,'projet&project');
|
$result = restrictedArea($user, 'projet', $object->id,'projet&project');
|
||||||
|
|
||||||
@ -135,6 +136,12 @@ if (empty($reshook))
|
|||||||
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create with status validated immediatly
|
||||||
|
if (! empty($conf->global->PROJECT_CREATE_NO_DRAFT))
|
||||||
|
{
|
||||||
|
$status=Project::STATUS_VALIDATED;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -148,10 +155,10 @@ if (empty($reshook))
|
|||||||
$object->public = GETPOST('public','alpha');
|
$object->public = GETPOST('public','alpha');
|
||||||
$object->opp_amount = price2num(GETPOST('opp_amount'));
|
$object->opp_amount = price2num(GETPOST('opp_amount'));
|
||||||
$object->budget_amount = price2num(GETPOST('budget_amount'));
|
$object->budget_amount = price2num(GETPOST('budget_amount'));
|
||||||
$object->datec=dol_now();
|
$object->datec = dol_now();
|
||||||
$object->date_start=$date_start;
|
$object->date_start = $date_start;
|
||||||
$object->date_end=$date_end;
|
$object->date_end = $date_end;
|
||||||
$object->statuts = $status;
|
$object->statut = $status;
|
||||||
$object->opp_status = $opp_status;
|
$object->opp_status = $opp_status;
|
||||||
$object->opp_percent = $opp_percent;
|
$object->opp_percent = $opp_percent;
|
||||||
|
|
||||||
@ -365,7 +372,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($action == 'confirm_validate' && GETPOST('confirm') == 'yes')
|
if ($action == 'confirm_validate' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
$result = $object->setValid($user);
|
$result = $object->setValid($user);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
@ -374,7 +381,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_close' && GETPOST('confirm') == 'yes')
|
if ($action == 'confirm_close' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
$result = $object->setClose($user);
|
$result = $object->setClose($user);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
@ -383,7 +390,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_reopen' && GETPOST('confirm') == 'yes')
|
if ($action == 'confirm_reopen' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
$result = $object->setValid($user);
|
$result = $object->setValid($user);
|
||||||
if ($result <= 0)
|
if ($result <= 0)
|
||||||
@ -409,7 +416,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confirm') == 'yes')
|
if ($action == 'confirm_clone' && $user->rights->projet->creer && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
$clone_contacts=GETPOST('clone_contacts')?1:0;
|
$clone_contacts=GETPOST('clone_contacts')?1:0;
|
||||||
$clone_tasks=GETPOST('clone_tasks')?1:0;
|
$clone_tasks=GETPOST('clone_tasks')?1:0;
|
||||||
@ -885,12 +892,16 @@ elseif ($object->id > 0)
|
|||||||
|
|
||||||
// Opportunity percent
|
// Opportunity percent
|
||||||
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td><td>';
|
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td><td>';
|
||||||
if (strcmp($object->opp_percent,'')) print price($object->opp_percent,0,$langs,1,0).' %';
|
if (strcmp($object->opp_percent,'')) print price($object->opp_percent, 0, $langs, 1, 0).' %';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Opportunity Amount
|
// Opportunity Amount
|
||||||
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td><td>';
|
||||||
if (strcmp($object->opp_amount,'')) print price($object->opp_amount,0,$langs,1,0,0,$conf->currency);
|
/*if ($object->opp_status)
|
||||||
|
{
|
||||||
|
print price($obj->opp_amount, 1, $langs, 1, 0, -1, $conf->currency);
|
||||||
|
}*/
|
||||||
|
if (strcmp($object->opp_amount,'')) print price($object->opp_amount, 0, $langs, 1, 0, -1, $conf->currency);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,6 +103,20 @@ class Project extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $lines;
|
public $lines;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draft status
|
||||||
|
*/
|
||||||
|
const STATUS_DRAFT = 0;
|
||||||
|
/**
|
||||||
|
* Open/Validated status
|
||||||
|
*/
|
||||||
|
const STATUS_VALIDATED = 1;
|
||||||
|
/**
|
||||||
|
* Closed status
|
||||||
|
*/
|
||||||
|
const STATUS_CLOSED = 2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -383,8 +383,8 @@ if ($search_ref != '') $param.='&search_ref='.$search_ref;
|
|||||||
if ($search_label != '') $param.='&search_label='.$search_label;
|
if ($search_label != '') $param.='&search_label='.$search_label;
|
||||||
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
||||||
if ($search_status >= 0) $param.='&search_status='.$search_status;
|
if ($search_status >= 0) $param.='&search_status='.$search_status;
|
||||||
if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all','openedopp','none'))) $param.='&search_opp_status='.urlencode($search_opp_status);
|
if ((is_numeric($search_opp_status) && $search_opp_status >= 0) || in_array($search_opp_status, array('all','openedopp','none'))) $param.='&search_opp_status='.urlencode($search_opp_status);
|
||||||
if ((is_numeric($search_opp_percent) && $search_opp_percent >= 0) || in_array($search_opp_percent, array('all','openedopp','none'))) $param.='&search_opp_percent='.urlencode($search_opp_percent);
|
if ($search_opp_percent != '') $param.='&search_opp_percent='.urlencode($search_opp_percent);
|
||||||
if ($search_public != '') $param.='&search_public='.$search_public;
|
if ($search_public != '') $param.='&search_public='.$search_public;
|
||||||
if ($search_project_user != '') $param.='&search_project_user='.$search_project_user;
|
if ($search_project_user != '') $param.='&search_project_user='.$search_project_user;
|
||||||
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
if ($search_sale > 0) $param.='&search_sale='.$search_sale;
|
||||||
@ -532,18 +532,18 @@ if (! empty($arrayfields['p.public']['checked']))
|
|||||||
print $form->selectarray('search_public',$array,$search_public);
|
print $form->selectarray('search_public',$array,$search_public);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['p.opp_amount']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre nowrap right">';
|
|
||||||
print '<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.'">';
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre nowrap center">';
|
print '<td class="liste_titre nowrap center">';
|
||||||
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100');
|
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
if (! empty($arrayfields['p.opp_amount']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre nowrap right">';
|
||||||
|
print '<input type="text" class="flat" name="search_opp_amount" size="3" value="'.$search_opp_amount.'">';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
if (! empty($arrayfields['p.opp_percent']['checked']))
|
if (! empty($arrayfields['p.opp_percent']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre nowrap right">';
|
print '<td class="liste_titre nowrap right">';
|
||||||
@ -620,8 +620,8 @@ if (! empty($arrayfields['commercial']['checked'])) print_liste_field_titre
|
|||||||
if (! empty($arrayfields['p.dateo']['checked'])) print_liste_field_titre($arrayfields['p.dateo']['label'],$_SERVER["PHP_SELF"],"p.dateo","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.dateo']['checked'])) print_liste_field_titre($arrayfields['p.dateo']['label'],$_SERVER["PHP_SELF"],"p.dateo","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.datee']['checked'])) print_liste_field_titre($arrayfields['p.datee']['label'],$_SERVER["PHP_SELF"],"p.datee","",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.datee']['checked'])) print_liste_field_titre($arrayfields['p.datee']['label'],$_SERVER["PHP_SELF"],"p.datee","",$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.public']['checked'])) print_liste_field_titre($arrayfields['p.public']['label'],$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
|
if (! empty($arrayfields['p.public']['checked'])) print_liste_field_titre($arrayfields['p.public']['label'],$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder);
|
|
||||||
if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'],$_SERVER["PHP_SELF"],'p.fk_opp_status',"",$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre($arrayfields['p.fk_opp_status']['label'],$_SERVER["PHP_SELF"],'p.fk_opp_status',"",$param,'align="center"',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder);
|
if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -770,20 +770,7 @@ while ($i < min($num,$limit))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Opp Amount
|
// Opp Status
|
||||||
if (! empty($arrayfields['p.opp_amount']['checked']))
|
|
||||||
{
|
|
||||||
print '<td align="right">';
|
|
||||||
if ($obj->opp_status_code)
|
|
||||||
{
|
|
||||||
print price($obj->opp_amount, 1, '', 1, -1, -1, '');
|
|
||||||
$totalarray['totalopp'] += $obj->opp_amount;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
if (! $i) $totalarray['nbfield']++;
|
|
||||||
if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
|
|
||||||
}
|
|
||||||
// Opp Status
|
|
||||||
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
@ -791,11 +778,25 @@ while ($i < min($num,$limit))
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
// Opp Amount
|
||||||
|
if (! empty($arrayfields['p.opp_amount']['checked']))
|
||||||
|
{
|
||||||
|
print '<td align="right">';
|
||||||
|
//if ($obj->opp_status_code)
|
||||||
|
if (strcmp($obj->opp_amount,''))
|
||||||
|
{
|
||||||
|
print price($obj->opp_amount, 1, $langs, 1, -1, -1, '');
|
||||||
|
$totalarray['totalopp'] += $obj->opp_amount;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
|
||||||
|
}
|
||||||
// Opp percent
|
// Opp percent
|
||||||
if (! empty($arrayfields['p.opp_percent']['checked']))
|
if (! empty($arrayfields['p.opp_percent']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($obj->opp_percent) print price($obj->opp_percent, 1, '', 1, 0).'%';
|
if ($obj->opp_percent) print price($obj->opp_percent, 1, $langs, 1, 0).'%';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
@ -805,7 +806,7 @@ while ($i < min($num,$limit))
|
|||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($obj->budget_amount != '')
|
if ($obj->budget_amount != '')
|
||||||
{
|
{
|
||||||
print price($obj->budget_amount, 1, '', 1, -1, -1);
|
print price($obj->budget_amount, 1, $langs, 1, -1, -1);
|
||||||
$totalarray['totalbudget'] += $obj->budget_amount;
|
$totalarray['totalbudget'] += $obj->budget_amount;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -826,9 +827,9 @@ while ($i < min($num,$limit))
|
|||||||
$tmpkey='options_'.$key;
|
$tmpkey='options_'.$key;
|
||||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $i) $totalarray['nbfield']++;
|
|
||||||
}
|
}
|
||||||
// Fields from hook
|
// Fields from hook
|
||||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
@ -887,8 +888,8 @@ if (isset($totalarray['totaloppfield']) || isset($totalarray['totalbudgetfield']
|
|||||||
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
|
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||||
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||||
}
|
}
|
||||||
elseif ($totalarray['totaloppfield'] == $i) print '<td align="right">'.price($totalarray['totalopp']).'</td>';
|
elseif ($totalarray['totaloppfield'] == $i) print '<td align="right">'.price($totalarray['totalopp'], 1, $langs, 1, -1, -1).'</td>';
|
||||||
elseif ($totalarray['totalbudgetfield'] == $i) print '<td align="right">'.price($totalarray['totalbudget']).'</td>';
|
elseif ($totalarray['totalbudgetfield'] == $i) print '<td align="right">'.price($totalarray['totalbudget'], 1, $langs, 1, -1, -1).'</td>';
|
||||||
else print '<td></td>';
|
else print '<td></td>';
|
||||||
}
|
}
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -257,66 +257,63 @@ if ($ret)
|
|||||||
{
|
{
|
||||||
foreach ($object->lines as $resource)
|
foreach ($object->lines as $resource)
|
||||||
{
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
if (! empty($arrayfields['t.ref']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
print $resource->getNomUrl(5);
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
$style='';
|
if (! empty($arrayfields['ty.label']['checked']))
|
||||||
if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"';
|
{
|
||||||
|
print '<td>';
|
||||||
|
print $resource->type_label;
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
// Extra fields
|
||||||
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
|
{
|
||||||
|
foreach($extrafields->attribute_label as $key => $val)
|
||||||
|
{
|
||||||
|
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||||
|
{
|
||||||
|
print '<td';
|
||||||
|
$align=$extrafields->getAlignFlag($key);
|
||||||
|
if ($align) print ' align="'.$align.'"';
|
||||||
|
print '>';
|
||||||
|
$tmpkey='options_'.$key;
|
||||||
|
print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1);
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr '.$bc[$var].' '.$style.'>';
|
print '<td align="center">';
|
||||||
|
print '<a href="./card.php?action=edit&id='.$resource->id.'">';
|
||||||
|
print img_edit();
|
||||||
|
print '</a>';
|
||||||
|
print ' ';
|
||||||
|
print '<a href="./card.php?action=delete&id='.$resource->id.'">';
|
||||||
|
print img_delete();
|
||||||
|
print '</a>';
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
if (! empty($arrayfields['t.ref']['checked']))
|
print '</tr>';
|
||||||
{
|
|
||||||
print '<td>';
|
|
||||||
print $resource->getNomUrl(5);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($arrayfields['ty.label']['checked']))
|
|
||||||
{
|
|
||||||
print '<td>';
|
|
||||||
print $resource->type_label;
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
// Extra fields
|
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
|
||||||
{
|
|
||||||
foreach($extrafields->attribute_label as $key => $val)
|
|
||||||
{
|
|
||||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
|
||||||
{
|
|
||||||
print '<td';
|
|
||||||
$align=$extrafields->getAlignFlag($key);
|
|
||||||
if ($align) print ' align="'.$align.'"';
|
|
||||||
print '>';
|
|
||||||
$tmpkey='options_'.$key;
|
|
||||||
print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $i) $totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<td align="center">';
|
|
||||||
print '<a href="./card.php?action=edit&id='.$resource->id.'">';
|
|
||||||
print img_edit();
|
|
||||||
print '</a>';
|
|
||||||
print ' ';
|
|
||||||
print '<a href="./card.php?action=delete&id='.$resource->id.'">';
|
|
||||||
print img_delete();
|
|
||||||
print '</a>';
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '</tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
|
||||||
print "</form>\n";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td class="opacitymedium">'.$langs->trans('NoResourceInDatabase').'</td></tr>';
|
print '<tr><td class="opacitymedium">'.$langs->trans('NoResourceInDatabase').'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
print '</table>';
|
||||||
|
print "</form>\n";
|
||||||
|
|
||||||
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -930,6 +930,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num, $limit))
|
while ($i < min($num, $limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
@ -955,46 +956,55 @@ while ($i < min($num, $limit))
|
|||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
print $companystatic->getNomUrl(1,'',100);
|
print $companystatic->getNomUrl(1,'',100);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Barcode
|
// Barcode
|
||||||
if (! empty($arrayfields['s.barcode']['checked']))
|
if (! empty($arrayfields['s.barcode']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->barcode.'</td>';
|
print '<td>'.$obj->barcode.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Customer code
|
// Customer code
|
||||||
if (! empty($arrayfields['s.code_client']['checked']))
|
if (! empty($arrayfields['s.code_client']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->code_client.'</td>';
|
print '<td>'.$obj->code_client.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Supplier code
|
// Supplier code
|
||||||
if (! empty($arrayfields['s.code_fournisseur']['checked']))
|
if (! empty($arrayfields['s.code_fournisseur']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->code_fournisseur.'</td>';
|
print '<td>'.$obj->code_fournisseur.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Account customer code
|
// Account customer code
|
||||||
if (! empty($arrayfields['s.code_compta']['checked']))
|
if (! empty($arrayfields['s.code_compta']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->code_compta.'</td>';
|
print '<td>'.$obj->code_compta.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Account supplier code
|
// Account supplier code
|
||||||
if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
|
if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->code_compta_fournisseur.'</td>';
|
print '<td>'.$obj->code_compta_fournisseur.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Town
|
// Town
|
||||||
if (! empty($arrayfields['s.town']['checked']))
|
if (! empty($arrayfields['s.town']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->town."</td>\n";
|
print "<td>".$obj->town."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Zip
|
// Zip
|
||||||
if (! empty($arrayfields['s.zip']['checked']))
|
if (! empty($arrayfields['s.zip']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->zip."</td>\n";
|
print "<td>".$obj->zip."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// State
|
// State
|
||||||
if (! empty($arrayfields['state.nom']['checked']))
|
if (! empty($arrayfields['state.nom']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->state_name."</td>\n";
|
print "<td>".$obj->state_name."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Country
|
// Country
|
||||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||||
@ -1003,6 +1013,7 @@ while ($i < min($num, $limit))
|
|||||||
$tmparray=getCountry($obj->fk_pays,'all');
|
$tmparray=getCountry($obj->fk_pays,'all');
|
||||||
print $tmparray['label'];
|
print $tmparray['label'];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Type ent
|
// Type ent
|
||||||
if (! empty($arrayfields['typent.code']['checked']))
|
if (! empty($arrayfields['typent.code']['checked']))
|
||||||
@ -1011,42 +1022,52 @@ while ($i < min($num, $limit))
|
|||||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||||
print $typenArray[$obj->typent_code];
|
print $typenArray[$obj->typent_code];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.email']['checked']))
|
if (! empty($arrayfields['s.email']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->email."</td>\n";
|
print "<td>".$obj->email."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.phone']['checked']))
|
if (! empty($arrayfields['s.phone']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->phone."</td>\n";
|
print "<td>".$obj->phone."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.url']['checked']))
|
if (! empty($arrayfields['s.url']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->url."</td>\n";
|
print "<td>".$obj->url."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.siren']['checked']))
|
if (! empty($arrayfields['s.siren']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof1."</td>\n";
|
print "<td>".$obj->idprof1."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.siret']['checked']))
|
if (! empty($arrayfields['s.siret']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof2."</td>\n";
|
print "<td>".$obj->idprof2."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.ape']['checked']))
|
if (! empty($arrayfields['s.ape']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof3."</td>\n";
|
print "<td>".$obj->idprof3."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.idprof4']['checked']))
|
if (! empty($arrayfields['s.idprof4']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof4."</td>\n";
|
print "<td>".$obj->idprof4."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.idprof5']['checked']))
|
if (! empty($arrayfields['s.idprof5']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof5."</td>\n";
|
print "<td>".$obj->idprof5."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['s.idprof6']['checked']))
|
if (! empty($arrayfields['s.idprof6']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->idprof6."</td>\n";
|
print "<td>".$obj->idprof6."</td>\n";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Type
|
// Type
|
||||||
if (! empty($arrayfields['customerorsupplier']['checked']))
|
if (! empty($arrayfields['customerorsupplier']['checked']))
|
||||||
@ -1075,6 +1096,7 @@ while ($i < min($num, $limit))
|
|||||||
}
|
}
|
||||||
print $s;
|
print $s;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
||||||
@ -1083,6 +1105,7 @@ while ($i < min($num, $limit))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print $companystatic->getLibProspLevel();
|
print $companystatic->getLibProspLevel();
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['s.fk_stcomm']['checked']))
|
if (! empty($arrayfields['s.fk_stcomm']['checked']))
|
||||||
@ -1098,6 +1121,7 @@ while ($i < min($num, $limit))
|
|||||||
if ($obj->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommsocid='.$obj->rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code']).'</a>';
|
if ($obj->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?stcommsocid='.$obj->rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code']).'</a>';
|
||||||
}
|
}
|
||||||
print '</div></div></td>';
|
print '</div></div></td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Extra fields
|
// Extra fields
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||||
@ -1113,6 +1137,7 @@ while ($i < min($num, $limit))
|
|||||||
$tmpkey='options_'.$key;
|
$tmpkey='options_'.$key;
|
||||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1126,6 +1151,7 @@ while ($i < min($num, $limit))
|
|||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date modification
|
// Date modification
|
||||||
if (! empty($arrayfields['s.tms']['checked']))
|
if (! empty($arrayfields['s.tms']['checked']))
|
||||||
@ -1133,11 +1159,13 @@ while ($i < min($num, $limit))
|
|||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['s.status']['checked']))
|
if (! empty($arrayfields['s.status']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center" class="nowrap">'.$companystatic->getLibStatut(3).'</td>';
|
print '<td align="center" class="nowrap">'.$companystatic->getLibStatut(3).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
|
|||||||
@ -4179,7 +4179,7 @@ dl.dropdown {
|
|||||||
position:absolute;
|
position:absolute;
|
||||||
top:2px;
|
top:2px;
|
||||||
list-style:none;
|
list-style:none;
|
||||||
max-height: 300px;
|
max-height: 280px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.dropdown span.value {
|
.dropdown span.value {
|
||||||
|
|||||||
@ -4266,7 +4266,7 @@ dl.dropdown {
|
|||||||
position:absolute;
|
position:absolute;
|
||||||
top:2px;
|
top:2px;
|
||||||
list-style:none;
|
list-style:none;
|
||||||
max-height: 300px;
|
max-height: 280px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
.dropdown span.value {
|
.dropdown span.value {
|
||||||
|
|||||||
@ -465,6 +465,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$totalarray=array();
|
||||||
while ($i < min($num,$limit))
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
@ -497,32 +498,39 @@ while ($i < min($num,$limit))
|
|||||||
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
|
print img_picto($langs->trans("Administrator"), 'star', 'class="valignmiddle paddingleft"');
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.lastname']['checked']))
|
if (! empty($arrayfields['u.lastname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->lastname.'</td>';
|
print '<td>'.$obj->lastname.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.firstname']['checked']))
|
if (! empty($arrayfields['u.firstname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->firstname.'</td>';
|
print '<td>'.$obj->firstname.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.gender']['checked']))
|
if (! empty($arrayfields['u.gender']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($obj->gender) print $langs->trans("Gender".$obj->gender);
|
if ($obj->gender) print $langs->trans("Gender".$obj->gender);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.employee']['checked']))
|
if (! empty($arrayfields['u.employee']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.yn($obj->employee).'</td>';
|
print '<td>'.yn($obj->employee).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->accountancy_code.'</td>';
|
print '<td>'.$obj->accountancy_code.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.email']['checked']))
|
if (! empty($arrayfields['u.email']['checked']))
|
||||||
{
|
{
|
||||||
print '<td>'.$obj->email.'</td>';
|
print '<td>'.$obj->email.'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||||
{
|
{
|
||||||
@ -543,6 +551,7 @@ while ($i < min($num,$limit))
|
|||||||
print $langs->trans("InternalUser");
|
print $langs->trans("InternalUser");
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Multicompany enabled
|
// Multicompany enabled
|
||||||
if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
if (! empty($conf->multicompany->enabled) && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||||
@ -560,6 +569,7 @@ while ($i < min($num,$limit))
|
|||||||
print $mc->label;
|
print $mc->label;
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Supervisor
|
// Supervisor
|
||||||
@ -589,17 +599,20 @@ while ($i < min($num,$limit))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date last login
|
// Date last login
|
||||||
if (! empty($arrayfields['u.datelastlogin']['checked']))
|
if (! empty($arrayfields['u.datelastlogin']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>';
|
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date previous login
|
// Date previous login
|
||||||
if (! empty($arrayfields['u.datepreviouslogin']['checked']))
|
if (! empty($arrayfields['u.datepreviouslogin']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extra fields
|
// Extra fields
|
||||||
@ -616,6 +629,7 @@ while ($i < min($num,$limit))
|
|||||||
$tmpkey='options_'.$key;
|
$tmpkey='options_'.$key;
|
||||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -629,6 +643,7 @@ while ($i < min($num,$limit))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Date modification
|
// Date modification
|
||||||
if (! empty($arrayfields['u.tms']['checked']))
|
if (! empty($arrayfields['u.tms']['checked']))
|
||||||
@ -636,15 +651,18 @@ while ($i < min($num,$limit))
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Status
|
// Status
|
||||||
if (! empty($arrayfields['u.statut']['checked']))
|
if (! empty($arrayfields['u.statut']['checked']))
|
||||||
{
|
{
|
||||||
$userstatic->statut=$obj->statut;
|
$userstatic->statut=$obj->statut;
|
||||||
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
|
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user