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;
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
@ -706,56 +707,67 @@ while ($i < min($num,$limit))
|
||||
print '<td valign="middle">';
|
||||
print $contactstatic->getNomUrl(1,'',0);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Firstname
|
||||
if (! empty($arrayfields['p.firstname']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Zip
|
||||
if (! empty($arrayfields['p.zip']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->zip.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Town
|
||||
if (! empty($arrayfields['p.town']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->town.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Function
|
||||
if (! empty($arrayfields['p.poste']['checked']))
|
||||
{
|
||||
print '<td>'.dol_trunc($obj->poste,20).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone
|
||||
if (! empty($arrayfields['p.phone']['checked']))
|
||||
{
|
||||
print '<td>'.dol_print_phone($obj->phone_pro,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone perso
|
||||
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>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Phone mobile
|
||||
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>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Fax
|
||||
if (! empty($arrayfields['p.fax']['checked']))
|
||||
{
|
||||
print '<td>'.dol_print_phone($obj->fax,$obj->country_code,$obj->rowid,$obj->socid,'AC_TEL').'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// EMail
|
||||
if (! empty($arrayfields['p.email']['checked']))
|
||||
{
|
||||
print '<td>'.dol_print_email($obj->email,$obj->rowid,$obj->socid,'AC_EMAIL',18).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Skype
|
||||
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 (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Company
|
||||
if (! empty($arrayfields['p.thirdparty']['checked']))
|
||||
@ -770,12 +782,14 @@ while ($i < min($num,$limit))
|
||||
else
|
||||
print ' ';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Private/Public
|
||||
if (! empty($arrayfields['p.priv']['checked']))
|
||||
{
|
||||
print '<td align="center">'.$contactstatic->LibPubPriv($obj->priv).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
@ -792,6 +806,7 @@ while ($i < min($num,$limit))
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -805,6 +820,7 @@ while ($i < min($num,$limit))
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date modification
|
||||
if (! empty($arrayfields['p.tms']['checked']))
|
||||
@ -812,11 +828,13 @@ while ($i < min($num,$limit))
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Status
|
||||
if (! empty($arrayfields['p.statut']['checked']))
|
||||
{
|
||||
print '<td align="center">'.$contactstatic->getLibStatut(3).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
@ -829,7 +847,7 @@ while ($i < min($num,$limit))
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -3692,7 +3692,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
|
||||
* @param float $amount Amount to format
|
||||
* @param integer $form Type of format, HTML or not (not by default)
|
||||
* @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 $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)
|
||||
|
||||
@ -179,7 +179,7 @@ $arrayfields=array(
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
|
||||
}
|
||||
@ -219,16 +219,16 @@ if (empty($reshook))
|
||||
$search_accountancy_code_buy='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Product';
|
||||
if ((string) $search_type == '1') { $objectlabel='Services'; }
|
||||
if ((string) $search_type == '0') { $objectlabel='Products'; }
|
||||
|
||||
|
||||
$permtoread = $user->rights->produit->lire;
|
||||
$permtodelete = $user->rights->produit->supprimer;
|
||||
$uploaddir = $conf->product->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
|
||||
@ -324,7 +324,7 @@ else
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@ -361,7 +361,7 @@ else
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -415,8 +415,8 @@ else
|
||||
$crit=$val;
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
@ -425,7 +425,7 @@ else
|
||||
if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" name="formulaire">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -473,7 +473,7 @@ else
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
|
||||
}
|
||||
|
||||
|
||||
// Filter on categories
|
||||
$moreforfilter='';
|
||||
if (! empty($conf->categorie->enabled))
|
||||
@ -505,10 +505,10 @@ else
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
// Lines with input filters
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (! empty($arrayfields['p.ref']['checked']))
|
||||
@ -591,7 +591,7 @@ else
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked'])) print '<td class="liste_titre"></td>';
|
||||
}
|
||||
@ -668,12 +668,13 @@ else
|
||||
if (! empty($arrayfields['p.tobuy']['checked'])) print_liste_field_titre($langs->trans("Status").' ('.$langs->trans("Buy").')',$_SERVER["PHP_SELF"],"p.tobuy","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
$product_static=new Product($db);
|
||||
$product_fourn =new ProductFournisseur($db);
|
||||
|
||||
$i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -721,6 +722,7 @@ else
|
||||
print '<td class="nowrap">';
|
||||
print $product_static->getNomUrl(1,'',24);
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Ref supplier
|
||||
if (! empty($arrayfields['pfp.ref_fourn']['checked']))
|
||||
@ -728,24 +730,28 @@ else
|
||||
print '<td class="nowrap">';
|
||||
print $product_static->getNomUrl(1,'',24);
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Label
|
||||
if (! empty($arrayfields['p.label']['checked']))
|
||||
{
|
||||
print '<td>'.dol_trunc($obj->label,40).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Type
|
||||
if (! empty($arrayfields['p.fk_product_type']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->fk_product_type.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
// Barcode
|
||||
if (! empty($arrayfields['p.barcode']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->barcode.'</td>';
|
||||
}
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Duration
|
||||
if (! empty($arrayfields['p.duration']['checked']))
|
||||
@ -761,6 +767,7 @@ else
|
||||
else print $obj->duration;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Sell price
|
||||
@ -773,6 +780,7 @@ else
|
||||
else print price($obj->price).' '.$langs->trans("HT");
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Better buy price
|
||||
@ -796,6 +804,7 @@ else
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Limit alert
|
||||
@ -807,6 +816,7 @@ else
|
||||
print $obj->seuil_stock_alerte;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Desired stock
|
||||
if (! empty($arrayfields['p.desiredstock']['checked']))
|
||||
@ -817,6 +827,7 @@ else
|
||||
print $obj->desiredstock;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Stock
|
||||
if (! empty($arrayfields['p.stock']['checked']))
|
||||
@ -828,7 +839,8 @@ else
|
||||
print $product_static->stock_reel;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Stock
|
||||
if (! empty($arrayfields['stock_virtual']['checked']))
|
||||
{
|
||||
@ -839,24 +851,34 @@ else
|
||||
print $product_static->stock_theorique;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Lot/Serial
|
||||
if (! empty($arrayfields['p.tobatch']['checked']))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print yn($obj->tobatch);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// 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
|
||||
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
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
if (! empty($arrayfields["ef.".$key]['checked']))
|
||||
{
|
||||
print '<td';
|
||||
$align=$extrafields->getAlignFlag($key);
|
||||
@ -865,6 +887,7 @@ else
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -878,6 +901,7 @@ else
|
||||
print '<td align="center">';
|
||||
print dol_print_date($obj->date_creation, 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date modification
|
||||
if (! empty($arrayfields['p.tms']['checked']))
|
||||
@ -885,8 +909,9 @@ else
|
||||
print '<td align="center">';
|
||||
print dol_print_date($obj->date_update, 'dayhour');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Status (to sell)
|
||||
if (! empty($arrayfields['p.tosell']['checked']))
|
||||
{
|
||||
@ -897,6 +922,7 @@ else
|
||||
print $product_static->LibStatut($obj->tosell,5,0);
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Status (to buy)
|
||||
if (! empty($arrayfields['p.tobuy']['checked']))
|
||||
@ -908,6 +934,7 @@ else
|
||||
print $product_static->LibStatut($obj->tobuy,5,1);
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Action
|
||||
print '<td class="nowrap" align="center">';
|
||||
@ -918,11 +945,12 @@ else
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
print "</table>";
|
||||
|
||||
@ -41,6 +41,7 @@ $ref=GETPOST('ref','alpha');
|
||||
$action=GETPOST('action','alpha');
|
||||
$backtopage=GETPOST('backtopage','alpha');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
$confirm=GETPOST('confirm','aZ09');
|
||||
$status=GETPOST('status','int');
|
||||
$opp_status=GETPOST('opp_status','int');
|
||||
$opp_percent=price2num(GETPOST('opp_percent','alpha'));
|
||||
@ -68,7 +69,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// 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.
|
||||
$result = restrictedArea($user, 'projet', $object->id,'projet&project');
|
||||
|
||||
@ -135,6 +136,12 @@ if (empty($reshook))
|
||||
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)
|
||||
{
|
||||
$error=0;
|
||||
@ -148,10 +155,10 @@ if (empty($reshook))
|
||||
$object->public = GETPOST('public','alpha');
|
||||
$object->opp_amount = price2num(GETPOST('opp_amount'));
|
||||
$object->budget_amount = price2num(GETPOST('budget_amount'));
|
||||
$object->datec=dol_now();
|
||||
$object->date_start=$date_start;
|
||||
$object->date_end=$date_end;
|
||||
$object->statuts = $status;
|
||||
$object->datec = dol_now();
|
||||
$object->date_start = $date_start;
|
||||
$object->date_end = $date_end;
|
||||
$object->statut = $status;
|
||||
$object->opp_status = $opp_status;
|
||||
$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);
|
||||
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);
|
||||
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);
|
||||
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_tasks=GETPOST('clone_tasks')?1:0;
|
||||
@ -885,12 +892,16 @@ elseif ($object->id > 0)
|
||||
|
||||
// Opportunity percent
|
||||
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>';
|
||||
|
||||
// Opportunity Amount
|
||||
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>';
|
||||
}
|
||||
|
||||
|
||||
@ -103,6 +103,20 @@ class Project extends CommonObject
|
||||
*/
|
||||
public $lines;
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
*/
|
||||
const STATUS_DRAFT = 0;
|
||||
/**
|
||||
* Open/Validated status
|
||||
*/
|
||||
const STATUS_VALIDATED = 1;
|
||||
/**
|
||||
* Closed status
|
||||
*/
|
||||
const STATUS_CLOSED = 2;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -135,7 +135,7 @@ $arrayfields=array(
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||
}
|
||||
@ -186,7 +186,7 @@ if (empty($reshook))
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Mass actions
|
||||
$objectclass='Project';
|
||||
@ -297,12 +297,12 @@ else if ($search_eyear > 0)
|
||||
$sql.= " AND p.datee BETWEEN '".$db->idate(dol_get_first_day($search_eyear,1,false))."' AND '".$db->idate(dol_get_last_day($search_eyear,12,false))."'";
|
||||
}
|
||||
if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
if ($search_status >= 0)
|
||||
if ($search_status >= 0)
|
||||
{
|
||||
if ($search_status == 99) $sql .= " AND p.fk_statut <> 2";
|
||||
else $sql .= " AND p.fk_statut = ".$db->escape($search_status);
|
||||
}
|
||||
if ($search_opp_status)
|
||||
if ($search_opp_status)
|
||||
{
|
||||
if (is_numeric($search_opp_status) && $search_opp_status > 0) $sql .= " AND p.fk_opp_status = ".$db->escape($search_opp_status);
|
||||
if ($search_opp_status == 'all') $sql .= " AND p.fk_opp_status IS NOT NULL";
|
||||
@ -313,7 +313,7 @@ if ($search_public!='') $sql .= " AND p.public = ".$db->escape($search_public);
|
||||
if ($search_sale > 0) $sql.= " AND sc.fk_user = " .$search_sale;
|
||||
// For external user, no check is done on company permission because readability is managed by public status of project and assignement.
|
||||
//if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND ((s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id.") OR (s.rowid IS NULL))";
|
||||
if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user;
|
||||
if ($search_project_user > 0) $sql.= " AND ecp.fk_c_type_contact IN (".join(',',array_keys($listofprojectcontacttype)).") AND ecp.element_id = p.rowid AND ecp.fk_socpeople = ".$search_project_user;
|
||||
if ($search_opp_amount != '') $sql .= natural_search('p.opp_amount', $search_opp_amount, 1);
|
||||
if ($search_budget_amount != '') $sql .= natural_search('p.budget_amount', $search_budget_amount, 1);
|
||||
// Add where from extra fields
|
||||
@ -324,7 +324,7 @@ foreach ($search_array_options as $key => $val)
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@ -383,8 +383,8 @@ if ($search_ref != '') $param.='&search_ref='.$search_ref;
|
||||
if ($search_label != '') $param.='&search_label='.$search_label;
|
||||
if ($search_societe != '') $param.='&search_societe='.$search_societe;
|
||||
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_percent) && $search_opp_percent >= 0) || in_array($search_opp_percent, array('all','openedopp','none'))) $param.='&search_opp_percent='.urlencode($search_opp_percent);
|
||||
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 ($search_opp_percent != '') $param.='&search_opp_percent='.urlencode($search_opp_percent);
|
||||
if ($search_public != '') $param.='&search_public='.$search_public;
|
||||
if ($search_project_user != '') $param.='&search_project_user='.$search_project_user;
|
||||
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 '</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']))
|
||||
{
|
||||
print '<td class="liste_titre nowrap center">';
|
||||
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100');
|
||||
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']))
|
||||
{
|
||||
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.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.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.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.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
|
||||
@ -661,7 +661,7 @@ while ($i < min($num,$limit))
|
||||
$object->datee = $db->jdate($obj->date_end);
|
||||
$object->statut = $obj->fk_statut;
|
||||
$object->opp_status = $obj->fk_opp_status;
|
||||
|
||||
|
||||
$userAccess = $object->restrictedProjectArea($user); // why this ?
|
||||
if ($userAccess >= 0)
|
||||
{
|
||||
@ -770,20 +770,7 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Opp Amount
|
||||
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
|
||||
// Opp Status
|
||||
if (! empty($arrayfields['p.fk_opp_status']['checked']))
|
||||
{
|
||||
print '<td class="center">';
|
||||
@ -791,11 +778,25 @@ while ($i < min($num,$limit))
|
||||
print '</td>';
|
||||
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
|
||||
if (! empty($arrayfields['p.opp_percent']['checked']))
|
||||
{
|
||||
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>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
@ -803,9 +804,9 @@ while ($i < min($num,$limit))
|
||||
if (! empty($arrayfields['p.budget_amount']['checked']))
|
||||
{
|
||||
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;
|
||||
}
|
||||
print '</td>';
|
||||
@ -826,9 +827,9 @@ while ($i < min($num,$limit))
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
@ -866,7 +867,7 @@ while ($i < min($num,$limit))
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
}
|
||||
@ -887,8 +888,8 @@ if (isset($totalarray['totaloppfield']) || isset($totalarray['totalbudgetfield']
|
||||
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
|
||||
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
|
||||
}
|
||||
elseif ($totalarray['totaloppfield'] == $i) print '<td align="right">'.price($totalarray['totalopp']).'</td>';
|
||||
elseif ($totalarray['totalbudgetfield'] == $i) print '<td align="right">'.price($totalarray['totalbudget']).'</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'], 1, $langs, 1, -1, -1).'</td>';
|
||||
else print '<td></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -257,66 +257,63 @@ if ($ret)
|
||||
{
|
||||
foreach ($object->lines as $resource)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$style='';
|
||||
if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"';
|
||||
if (! empty($arrayfields['t.ref']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print $resource->getNomUrl(5);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '<tr '.$bc[$var].' '.$style.'>';
|
||||
if (! empty($arrayfields['ty.label']['checked']))
|
||||
{
|
||||
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']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['t.ref']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
print $resource->getNomUrl(5);
|
||||
print '</td>';
|
||||
}
|
||||
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['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 '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td class="opacitymedium">'.$langs->trans('NoResourceInDatabase').'</td></tr>';
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@ -247,7 +247,7 @@ if (empty($reshook))
|
||||
$permtodelete = $user->rights->societe->supprimer;
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
|
||||
if ($action == 'setstcomm')
|
||||
{
|
||||
$object = new Client($db);
|
||||
@ -930,6 +930,7 @@ print "</tr>\n";
|
||||
|
||||
|
||||
$i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -955,46 +956,55 @@ while ($i < min($num, $limit))
|
||||
print '<td class="tdoverflowmax200">';
|
||||
print $companystatic->getNomUrl(1,'',100);
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Barcode
|
||||
if (! empty($arrayfields['s.barcode']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->barcode.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Customer code
|
||||
if (! empty($arrayfields['s.code_client']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->code_client.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Supplier code
|
||||
if (! empty($arrayfields['s.code_fournisseur']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->code_fournisseur.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Account customer code
|
||||
if (! empty($arrayfields['s.code_compta']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->code_compta.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Account supplier code
|
||||
if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->code_compta_fournisseur.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Town
|
||||
if (! empty($arrayfields['s.town']['checked']))
|
||||
{
|
||||
print "<td>".$obj->town."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Zip
|
||||
if (! empty($arrayfields['s.zip']['checked']))
|
||||
{
|
||||
print "<td>".$obj->zip."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// State
|
||||
if (! empty($arrayfields['state.nom']['checked']))
|
||||
{
|
||||
print "<td>".$obj->state_name."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Country
|
||||
if (! empty($arrayfields['country.code_iso']['checked']))
|
||||
@ -1003,6 +1013,7 @@ while ($i < min($num, $limit))
|
||||
$tmparray=getCountry($obj->fk_pays,'all');
|
||||
print $tmparray['label'];
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Type ent
|
||||
if (! empty($arrayfields['typent.code']['checked']))
|
||||
@ -1011,42 +1022,52 @@ while ($i < min($num, $limit))
|
||||
if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
|
||||
print $typenArray[$obj->typent_code];
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.email']['checked']))
|
||||
{
|
||||
print "<td>".$obj->email."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.phone']['checked']))
|
||||
{
|
||||
print "<td>".$obj->phone."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.url']['checked']))
|
||||
{
|
||||
print "<td>".$obj->url."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.siren']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof1."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.siret']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof2."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.ape']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof3."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.idprof4']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof4."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.idprof5']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof5."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['s.idprof6']['checked']))
|
||||
{
|
||||
print "<td>".$obj->idprof6."</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Type
|
||||
if (! empty($arrayfields['customerorsupplier']['checked']))
|
||||
@ -1075,6 +1096,7 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
print $s;
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
|
||||
@ -1083,6 +1105,7 @@ while ($i < min($num, $limit))
|
||||
print '<td align="center">';
|
||||
print $companystatic->getLibProspLevel();
|
||||
print "</td>";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
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>';
|
||||
}
|
||||
print '</div></div></td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
@ -1113,6 +1137,7 @@ while ($i < min($num, $limit))
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1126,6 +1151,7 @@ while ($i < min($num, $limit))
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date modification
|
||||
if (! empty($arrayfields['s.tms']['checked']))
|
||||
@ -1133,11 +1159,13 @@ while ($i < min($num, $limit))
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Status
|
||||
if (! empty($arrayfields['s.status']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">'.$companystatic->getLibStatut(3).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action column
|
||||
@ -1150,7 +1178,7 @@ while ($i < min($num, $limit))
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
|
||||
print '</tr>'."\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -4179,7 +4179,7 @@ dl.dropdown {
|
||||
position:absolute;
|
||||
top:2px;
|
||||
list-style:none;
|
||||
max-height: 300px;
|
||||
max-height: 280px;
|
||||
overflow: auto;
|
||||
}
|
||||
.dropdown span.value {
|
||||
|
||||
@ -4266,7 +4266,7 @@ dl.dropdown {
|
||||
position:absolute;
|
||||
top:2px;
|
||||
list-style:none;
|
||||
max-height: 300px;
|
||||
max-height: 280px;
|
||||
overflow: auto;
|
||||
}
|
||||
.dropdown span.value {
|
||||
|
||||
@ -465,6 +465,7 @@ print "</tr>\n";
|
||||
|
||||
|
||||
$i = 0;
|
||||
$totalarray=array();
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$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 '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.lastname']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->lastname.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.firstname']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->firstname.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.gender']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if ($obj->gender) print $langs->trans("Gender".$obj->gender);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.employee']['checked']))
|
||||
{
|
||||
print '<td>'.yn($obj->employee).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.accountancy_code']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->accountancy_code.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.email']['checked']))
|
||||
{
|
||||
print '<td>'.$obj->email.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (! empty($arrayfields['u.fk_soc']['checked']))
|
||||
{
|
||||
@ -543,6 +551,7 @@ while ($i < min($num,$limit))
|
||||
print $langs->trans("InternalUser");
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Multicompany enabled
|
||||
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 '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Supervisor
|
||||
@ -589,17 +599,20 @@ while ($i < min($num,$limit))
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Date last login
|
||||
if (! empty($arrayfields['u.datelastlogin']['checked']))
|
||||
{
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datelastlogin),"dayhour").'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date previous login
|
||||
if (! empty($arrayfields['u.datepreviouslogin']['checked']))
|
||||
{
|
||||
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($obj->datepreviouslogin),"dayhour").'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
@ -616,6 +629,7 @@ while ($i < min($num,$limit))
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -629,6 +643,7 @@ while ($i < min($num,$limit))
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->date_creation), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date modification
|
||||
if (! empty($arrayfields['u.tms']['checked']))
|
||||
@ -636,15 +651,18 @@ while ($i < min($num,$limit))
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($obj->date_update), 'dayhour');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Status
|
||||
if (! empty($arrayfields['u.statut']['checked']))
|
||||
{
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
|
||||
$userstatic->statut=$obj->statut;
|
||||
print '<td align="center">'.$userstatic->getLibStatut(3).'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Action column
|
||||
print '<td></td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user