';
print '
'."\n";
-
+
// Lines with input filters
print '';
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 ' ';
}
@@ -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 " \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 '';
print $product_static->getNomUrl(1,'',24);
print " \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Ref supplier
if (! empty($arrayfields['pfp.ref_fourn']['checked']))
@@ -728,24 +730,28 @@ else
print '';
print $product_static->getNomUrl(1,'',24);
print " \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Label
if (! empty($arrayfields['p.label']['checked']))
{
print ''.dol_trunc($obj->label,40).' ';
+ if (! $i) $totalarray['nbfield']++;
}
-
+
// Type
if (! empty($arrayfields['p.fk_product_type']['checked']))
{
print ''.$obj->fk_product_type.' ';
+ if (! $i) $totalarray['nbfield']++;
}
-
+
// Barcode
if (! empty($arrayfields['p.barcode']['checked']))
{
print ''.$obj->barcode.' ';
- }
+ if (! $i) $totalarray['nbfield']++;
+ }
// Duration
if (! empty($arrayfields['p.duration']['checked']))
@@ -761,6 +767,7 @@ else
else print $obj->duration;
}
print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Sell price
@@ -773,6 +780,7 @@ else
else print price($obj->price).' '.$langs->trans("HT");
}
print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Better buy price
@@ -796,6 +804,7 @@ else
}
}
print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Limit alert
@@ -807,6 +816,7 @@ else
print $obj->seuil_stock_alerte;
}
print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Desired stock
if (! empty($arrayfields['p.desiredstock']['checked']))
@@ -817,6 +827,7 @@ else
print $obj->desiredstock;
}
print '';
+ if (! $i) $totalarray['nbfield']++;
}
// Stock
if (! empty($arrayfields['p.stock']['checked']))
@@ -828,7 +839,8 @@ else
print $product_static->stock_reel;
}
print '';
- }
+ if (! $i) $totalarray['nbfield']++;
+ }
// Stock
if (! empty($arrayfields['stock_virtual']['checked']))
{
@@ -839,24 +851,34 @@ else
print $product_static->stock_theorique;
}
print '';
- }
+ if (! $i) $totalarray['nbfield']++;
+ }
// Lot/Serial
if (! empty($arrayfields['p.tobatch']['checked']))
{
print '';
print yn($obj->tobatch);
print ' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Accountancy code sell
- if (! empty($arrayfields['p.accountancy_code_sell']['checked'])) print ''.$obj->accountancy_code_sell.' ';
+ if (! empty($arrayfields['p.accountancy_code_sell']['checked']))
+ {
+ print ''.$obj->accountancy_code_sell.' ';
+ if (! $i) $totalarray['nbfield']++;
+ }
// Accountancy code sell
- if (! empty($arrayfields['p.accountancy_code_buy']['checked'])) print ''.$obj->accountancy_code_buy.' ';
+ if (! empty($arrayfields['p.accountancy_code_buy']['checked']))
+ {
+ print ''.$obj->accountancy_code_buy.' ';
+ 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 'getAlignFlag($key);
@@ -865,6 +887,7 @@ else
$tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print ' ';
+ if (! $i) $totalarray['nbfield']++;
}
}
}
@@ -878,6 +901,7 @@ else
print '';
print dol_print_date($obj->date_creation, 'dayhour');
print ' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Date modification
if (! empty($arrayfields['p.tms']['checked']))
@@ -885,8 +909,9 @@ else
print '';
print dol_print_date($obj->date_update, 'dayhour');
print ' ';
- }
-
+ 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 '';
+ 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 '';
+ if (! $i) $totalarray['nbfield']++;
}
// Action
print '';
@@ -918,11 +945,12 @@ else
print ' ';
}
print ' ';
+ if (! $i) $totalarray['nbfield']++;
print "\n";
$i++;
}
-
+
$db->free($resql);
print "
";
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 0b45a0d0696..174d93f4aef 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -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 '
'.$langs->trans("OpportunityProbability").' ';
- 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 ' ';
// Opportunity Amount
print '
'.$langs->trans("OpportunityAmount").' ';
- 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 ' ';
}
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 6a53be25c54..b22ea32f646 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -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
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 851956f816b..b9da5379655 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -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 '';
}
-if (! empty($arrayfields['p.opp_amount']['checked']))
-{
- print '
';
- print ' ';
- print ' ';
-}
if (! empty($arrayfields['p.fk_opp_status']['checked']))
{
print '
';
print $formproject->selectOpportunityStatus('search_opp_status', $search_opp_status, 1, 1, 1, 0, 'maxwidth100');
print ' ';
}
+if (! empty($arrayfields['p.opp_amount']['checked']))
+{
+ print '
';
+ print ' ';
+ print ' ';
+}
if (! empty($arrayfields['p.opp_percent']['checked']))
{
print '
';
@@ -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 ' ';
if (! $i) $totalarray['nbfield']++;
}
- // Opp Amount
- if (! empty($arrayfields['p.opp_amount']['checked']))
- {
- print '
';
- if ($obj->opp_status_code)
- {
- print price($obj->opp_amount, 1, '', 1, -1, -1, '');
- $totalarray['totalopp'] += $obj->opp_amount;
- }
- print ' ';
- if (! $i) $totalarray['nbfield']++;
- if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
- }
- // Opp Status
+ // Opp Status
if (! empty($arrayfields['p.fk_opp_status']['checked']))
{
print '
';
@@ -791,11 +778,25 @@ while ($i < min($num,$limit))
print ' ';
if (! $i) $totalarray['nbfield']++;
}
+ // Opp Amount
+ if (! empty($arrayfields['p.opp_amount']['checked']))
+ {
+ print '
';
+ //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 ' ';
+ if (! $i) $totalarray['nbfield']++;
+ if (! $i) $totalarray['totaloppfield']=$totalarray['nbfield'];
+ }
// Opp percent
if (! empty($arrayfields['p.opp_percent']['checked']))
{
print '
';
- 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 ' ';
if (! $i) $totalarray['nbfield']++;
}
@@ -803,9 +804,9 @@ while ($i < min($num,$limit))
if (! empty($arrayfields['p.budget_amount']['checked']))
{
print '
';
- 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 ' ';
@@ -826,9 +827,9 @@ while ($i < min($num,$limit))
$tmpkey='options_'.$key;
print $extrafields->showOutputField($key, $obj->$tmpkey, '', 1);
print '';
+ 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 '';
if (! $i) $totalarray['nbfield']++;
-
+
print "\n";
}
@@ -887,8 +888,8 @@ if (isset($totalarray['totaloppfield']) || isset($totalarray['totalbudgetfield']
if ($num < $limit && empty($offset)) print '
'.$langs->trans("Total").' ';
else print '
'.$langs->trans("Totalforthispage").' ';
}
- elseif ($totalarray['totaloppfield'] == $i) print '
'.price($totalarray['totalopp']).' ';
- elseif ($totalarray['totalbudgetfield'] == $i) print '
'.price($totalarray['totalbudget']).' ';
+ elseif ($totalarray['totaloppfield'] == $i) print '
'.price($totalarray['totalopp'], 1, $langs, 1, -1, -1).' ';
+ elseif ($totalarray['totalbudgetfield'] == $i) print '
'.price($totalarray['totalbudget'], 1, $langs, 1, -1, -1).' ';
else print '
';
}
print '';
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index 44524cd7acd..d157cfc99d2 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -257,66 +257,63 @@ if ($ret)
{
foreach ($object->lines as $resource)
{
-
+ print '
';
- $style='';
- if ($resource->id == GETPOST('lineid')) $style='style="background: orange;"';
+ if (! empty($arrayfields['t.ref']['checked']))
+ {
+ print '';
+ print $resource->getNomUrl(5);
+ print ' ';
+ if (! $i) $totalarray['nbfield']++;
+ }
- print ' ';
+ if (! empty($arrayfields['ty.label']['checked']))
+ {
+ print '';
+ print $resource->type_label;
+ print ' ';
+ 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 'getAlignFlag($key);
+ if ($align) print ' align="'.$align.'"';
+ print '>';
+ $tmpkey='options_'.$key;
+ print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1);
+ print ' ';
+ if (! $i) $totalarray['nbfield']++;
+ }
+ }
+ }
- if (! empty($arrayfields['t.ref']['checked']))
- {
- print '';
- print $resource->getNomUrl(5);
- print ' ';
- }
+ print '';
+ print '';
+ print img_edit();
+ print ' ';
+ print ' ';
+ print '';
+ print img_delete();
+ print ' ';
+ print ' ';
+ if (! $i) $totalarray['nbfield']++;
- if (! empty($arrayfields['ty.label']['checked']))
- {
- print '';
- print $resource->type_label;
- print ' ';
- }
- // 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 'getAlignFlag($key);
- if ($align) print ' align="'.$align.'"';
- print '>';
- $tmpkey='options_'.$key;
- print $extrafields->showOutputField($key, $resource->array_options[$tmpkey], '', 1);
- print ' ';
- }
- }
- if (! $i) $totalarray['nbfield']++;
- }
-
- print '';
- print '';
- print img_edit();
- print ' ';
- print ' ';
- print '';
- print img_delete();
- print ' ';
- print ' ';
-
- print ' ';
+ print '';
}
-
- print '';
- print "\n";
}
else
{
print '
'.$langs->trans('NoResourceInDatabase').' ';
}
-llxFooter();
+print '';
+print "\n";
+llxFooter();
$db->close();
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 28d6ec27368..3cbd8768e92 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -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 "\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 '
';
print $companystatic->getNomUrl(1,'',100);
print " \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Barcode
if (! empty($arrayfields['s.barcode']['checked']))
{
print '
'.$obj->barcode.' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Customer code
if (! empty($arrayfields['s.code_client']['checked']))
{
print '
'.$obj->code_client.' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Supplier code
if (! empty($arrayfields['s.code_fournisseur']['checked']))
{
print '
'.$obj->code_fournisseur.' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Account customer code
if (! empty($arrayfields['s.code_compta']['checked']))
{
print '
'.$obj->code_compta.' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Account supplier code
if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
{
print '
'.$obj->code_compta_fournisseur.' ';
+ if (! $i) $totalarray['nbfield']++;
}
// Town
if (! empty($arrayfields['s.town']['checked']))
{
print "
".$obj->town." \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Zip
if (! empty($arrayfields['s.zip']['checked']))
{
print "
".$obj->zip." \n";
+ if (! $i) $totalarray['nbfield']++;
}
// State
if (! empty($arrayfields['state.nom']['checked']))
{
print "
".$obj->state_name." \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 '';
+ 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 '';
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.email']['checked']))
{
print "
".$obj->email." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.phone']['checked']))
{
print "
".$obj->phone." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.url']['checked']))
{
print "
".$obj->url." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.siren']['checked']))
{
print "
".$obj->idprof1." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.siret']['checked']))
{
print "
".$obj->idprof2." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.ape']['checked']))
{
print "
".$obj->idprof3." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.idprof4']['checked']))
{
print "
".$obj->idprof4." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.idprof5']['checked']))
{
print "
".$obj->idprof5." \n";
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.idprof6']['checked']))
{
print "
".$obj->idprof6." \n";
+ if (! $i) $totalarray['nbfield']++;
}
// Type
if (! empty($arrayfields['customerorsupplier']['checked']))
@@ -1075,6 +1096,7 @@ while ($i < min($num, $limit))
}
print $s;
print '';
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['s.fk_prospectlevel']['checked']))
@@ -1083,6 +1105,7 @@ while ($i < min($num, $limit))
print '
';
print $companystatic->getLibProspLevel();
print " ";
+ 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 '
rowid.'&stcomm='.$val['code'].'&action=setstcomm'.$param.($page?'&page='.urlencode($page):'').'">'.img_action($titlealt,$val['code']).' ';
}
print '
';
+ 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 '';
+ if (! $i) $totalarray['nbfield']++;
}
}
}
@@ -1126,6 +1151,7 @@ while ($i < min($num, $limit))
print '