Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: hregis/dolibarr
base: f42b493408
...
head fork: hregis/dolibarr
compare: 1b62e9d86d
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
8 htdocs/comm/list.php
@@ -104,9 +104,9 @@
if ($socid) $sql.= " AND s.rowid = ".$socid;
if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
if ($search_categ) $sql.= " AND s.rowid = cs.fk_societe"; // Join for the needed table to filter by categ
-if ($search_nom) $sql.= " AND s.nom like '%".$db->escape(strtolower($search_nom))."%'";
-if ($search_ville) $sql.= " AND s.ville like '%".$db->escape(strtolower($search_ville))."%'";
-if ($search_code) $sql.= " AND s.code_client like '%".$db->escape(strtolower($search_code))."%'";
+if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'";
+if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'";
+if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape(strtolower($search_code))."%'";
if ($search_compta) $sql .= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
// Insert sale filter
if ($search_sale)
@@ -120,7 +120,7 @@
}
if ($socname)
{
- $sql.= " AND s.nom like '%".$db->escape(strtolower($socname))."%'";
+ $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($socname))."%'";
$sortfield = "s.nom";
$sortorder = "ASC";
}
View
92 htdocs/comm/mailing/fiche.php
@@ -45,50 +45,50 @@
// Tableau des substitutions possibles
$substitutionarray=array(
-'__ID__' => 'IdRecord',
-'__EMAIL__' => 'EMail',
-'__LASTNAME__' => 'Lastname',
-'__FIRSTNAME__' => 'Firstname',
-'__OTHER1__' => 'Other1',
-'__OTHER2__' => 'Other2',
-'__OTHER3__' => 'Other3',
-'__OTHER4__' => 'Other4',
-'__OTHER5__' => 'Other5',
-'__SIGNATURE__' => 'Signature',
-'__PERSONALIZED__' => 'Personalized'
+ '__ID__' => 'IdRecord',
+ '__EMAIL__' => 'EMail',
+ '__LASTNAME__' => 'Lastname',
+ '__FIRSTNAME__' => 'Firstname',
+ '__OTHER1__' => 'Other1',
+ '__OTHER2__' => 'Other2',
+ '__OTHER3__' => 'Other3',
+ '__OTHER4__' => 'Other4',
+ '__OTHER5__' => 'Other5',
+ '__SIGNATURE__' => 'Signature',
+ '__PERSONALIZED__' => 'Personalized'
);
if ($conf->global->MAIN_SOCIETE_UNSUBSCRIBE)
{
- $substitutionarray=array_merge(
- $substitutionarray,
- array(
- '__CHECK_READ__' => 'CheckMail',
- '__UNSUSCRIBE__' => 'Unsuscribe'
- )
- );
+ $substitutionarray=array_merge(
+ $substitutionarray,
+ array(
+ '__CHECK_READ__' => 'CheckMail',
+ '__UNSUSCRIBE__' => 'Unsuscribe'
+ )
+ );
}
$substitutionarrayfortest=array(
-'__ID__' => 'TESTIdRecord',
-'__EMAIL__' => 'TESTEMail',
-'__LASTNAME__' => 'TESTLastname',
-'__FIRSTNAME__' => 'TESTFirstname',
-'__OTHER1__' => 'TESTOther1',
-'__OTHER2__' => 'TESTOther2',
-'__OTHER3__' => 'TESTOther3',
-'__OTHER4__' => 'TESTOther4',
-'__OTHER5__' => 'TESTOther5',
-'__SIGNATURE__' => 'TESTSignature',
-'__PERSONALIZED__' => 'TESTPersonalized'
+ '__ID__' => 'TESTIdRecord',
+ '__EMAIL__' => 'TESTEMail',
+ '__LASTNAME__' => 'TESTLastname',
+ '__FIRSTNAME__' => 'TESTFirstname',
+ '__OTHER1__' => 'TESTOther1',
+ '__OTHER2__' => 'TESTOther2',
+ '__OTHER3__' => 'TESTOther3',
+ '__OTHER4__' => 'TESTOther4',
+ '__OTHER5__' => 'TESTOther5',
+ '__SIGNATURE__' => 'TESTSignature',
+ '__PERSONALIZED__' => 'TESTPersonalized'
);
if ($conf->global->MAIN_SOCIETE_UNSUBSCRIBE)
{
- $substitutionarray=array_merge(
- $substitutionarray,
- array(
- '__CHECK_READ__' => 'TESTCheckMail',
- '__UNSUSCRIBE__' => 'TESTCheckMail'
- )
+ $substitutionarrayfortest=array_merge(
+ $substitutionarrayfortest,
+ array(
+ '__CHECK_READ__' => 'TESTCheckMail',
+ '__UNSUSCRIBE__' => 'TESTCheckMail'
+ )
);
}
@@ -206,17 +206,17 @@
$tmpfield=explode('=',$other[3],2); $other4=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$tmpfield=explode('=',$other[4],2); $other5=(isset($tmpfield[1])?$tmpfield[1]:$tmpfield[0]);
$substitutionarray=array(
- '__ID__' => $obj->source_id,
- '__EMAIL__' => $obj->email,
- '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
- '__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
- '__LASTNAME__' => $obj->nom,
- '__FIRSTNAME__' => $obj->prenom,
- '__OTHER1__' => $other1,
- '__OTHER2__' => $other2,
- '__OTHER3__' => $other3,
- '__OTHER4__' => $other4,
- '__OTHER5__' => $other5
+ '__ID__' => $obj->source_id,
+ '__EMAIL__' => $obj->email,
+ '__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj->tag.'" width="0" height="0" style="width:0px;height:0px" border="0"/>',
+ '__UNSUSCRIBE__' => '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.$obj->tag.'&unsuscrib=1" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>',
+ '__LASTNAME__' => $obj->nom,
+ '__FIRSTNAME__' => $obj->prenom,
+ '__OTHER1__' => $other1,
+ '__OTHER2__' => $other2,
+ '__OTHER3__' => $other3,
+ '__OTHER4__' => $other4,
+ '__OTHER5__' => $other5
);
$substitutionisok=true;
View
29 htdocs/comm/propal.php
@@ -55,6 +55,7 @@
$lineid=GETPOST('lineid','int');
$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
+$search_refcustomer=GETPOST('search_refcustomer','alpha');
$search_societe=GETPOST('search_societe','alpha');
$search_montant_ht=GETPOST('search_montant_ht','alpha');
@@ -1567,16 +1568,12 @@
include(DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php');
}
- // TODO test using div instead of tables
- //print '<div class="table" id="tablelines">';
print '<table id="tablelines" class="noborder" width="100%">';
// Show object lines
$result = $object->getLinesArray();
if (! empty($object->lines)) $object->printObjectLines($action,$mysoc,$soc,$lineid,0,$hookmanager);
- //print '<table id="tablelines" class="noborder" width="100%">';
-
/*
* Form to add new line
*/
@@ -1601,9 +1598,7 @@
}
}
- // TODO test using div instead of tables
print '</table>';
- //print '</div>';
print '</div>';
print "\n";
@@ -1872,18 +1867,18 @@
$limit = $conf->liste_limit;
$sql = 'SELECT s.nom, s.rowid, s.client, ';
- $sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
- if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
+ $sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
+ if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= ' u.login';
$sql.= ' FROM ('.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p';
- if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ')';
if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
$sql.= ' WHERE p.fk_soc = s.rowid';
$sql.= ' AND p.entity = '.$conf->entity;
- if (!$user->rights->societe->client->voir && !$socid) //restriction
+ if (! $user->rights->societe->client->voir && ! $socid) //restriction
{
$sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
}
@@ -1891,6 +1886,10 @@
{
$sql.= " AND p.ref LIKE '%".$db->escape(trim($search_ref))."%'";
}
+ if ($search_refcustomer)
+ {
+ $sql.= " AND p.ref_client LIKE '%".$db->escape(trim($search_refcustomer))."%'";
+ }
if ($search_societe)
{
$sql.= " AND s.nom LIKE '%".$db->escape(trim($search_societe))."%'";
@@ -1944,6 +1943,7 @@
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
@@ -1961,11 +1961,13 @@
print '<td class="liste_titre" align="left">';
print '<input class="flat" type="text" size="16" name="search_societe" value="'.$search_societe.'">';
print '</td>';
+ print '<td class="liste_titre">';
+ print '<input class="flat" size="10" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
+ print '</td>';
print '<td class="liste_titre" colspan="1" align="center">';
print $langs->trans('Month').': <input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
print '&nbsp;'.$langs->trans('Year').': ';
$syear = $year;
- //if($syear == '') $syear = date("Y");
$formother->select_year($syear,'year',1, 20, 5);
print '</td>';
print '<td class="liste_titre" colspan="1">&nbsp;</td>';
@@ -2026,6 +2028,11 @@
print '<td>';
print $companystatic->getNomUrl(1,'customer');
print '</td>';
+
+ // Customer ref
+ print '<td nowrap="nowrap">';
+ print $objp->ref_client;
+ print '</td>';
// Date propale
print '<td align="center">';
View
2  htdocs/commande/liste.php
@@ -2,7 +2,7 @@
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
- * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
+ * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
View
320 htdocs/core/class/commonobject.class.php
@@ -2347,183 +2347,159 @@ function formAddFreeProduct($dateSelector,$seller,$buyer,$hookmanager=false)
/* This is to show array of line of details */
- /**
- * Return HTML table for object lines
- * TODO Move this into an output class file (htmlline.class.php)
- * If lines are into a template, title must also be into a template
- * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
- *
- * @param string $action Action code
- * @param string $seller Object of seller third party
- * @param string $buyer Object of buyer third party
- * @param string $selected Object line selected
- * @param int $dateSelector 1=Show also date range input fields
- * @param HookManager $hookmanager Hookmanager
- * @return void
- */
- function printObjectLines($action,$seller,$buyer,$selected=0,$dateSelector=0,$hookmanager=false)
- {
- global $conf,$langs;
-
- // TODO test using div instead of tables
- /*
- print '<div class="table" id="tablelines">';
- print '<div class="thead">';
- print '<div class="tr">';
- print '<div class="td firstcol">'.$langs->trans('Description').'</div>';
- print '<div class="td">'.$langs->trans('VAT').'</div>';
- print '<div class="td">'.$langs->trans('PriceUHT').'</div>';
- print '<div class="td">'.$langs->trans('Qty').'</div>';
- print '<div class="td">'.$langs->trans('ReductionShort').'</div>';
- print '<div class="td">'.$langs->trans('TotalHTShort').'</div>';
- print '<div class="td endcol">&nbsp;</div>';
- print '<div class="td endcol">&nbsp;</div>';
- print '<div class="td end">&nbsp;</div>';
- print '</div></div>';
- */
-
- print '<tr class="liste_titre nodrag nodrop">';
- if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
- {
- print '<td align="center" width="5">&nbsp;</td>';
- }
- print '<td>'.$langs->trans('Description').'</td>';
- print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
- print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
- print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
- print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
- print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
- print '<td width="10">&nbsp;</td>';
- print '<td width="10">&nbsp;</td>';
- print '<td nowrap="nowrap">&nbsp;</td>'; // No width to allow autodim
- print "</tr>\n";
-
- $num = count($this->lines);
- $var = true;
- $i = 0;
-
- //print '<div class="tbody">';
-
- foreach ($this->lines as $line)
- {
- $var=!$var;
-
- if (is_object($hookmanager) && ( ($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line) ) )
- {
- if (empty($line->fk_parent_line))
- {
- $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected);
- $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
- }
- }
- else
- {
- $this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$hookmanager);
- }
-
- $i++;
- }
-
- //print '</div></div>';
- }
-
- /**
- * Return HTML content of a detail line
- * TODO Move this into an output class file (htmlline.class.php)
- * If lines are into a template, title must also be into a template
- * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
- *
- * @param string $action GET/POST action
- * @param array $line Selected object line to output
- * @param string $var Is it a an odd line (true)
- * @param int $num Number of line (0)
- * @param int $i I
- * @param int $dateSelector 1=Show also date range input fields
- * @param string $seller Object of seller third party
- * @param string $buyer Object of buyer third party
- * @param string $selected Object line selected
- * @param HookManager $hookmanager Hook manager
- * @return void
+ /**
+ * Return HTML table for object lines
+ * TODO Move this into an output class file (htmlline.class.php)
+ * If lines are into a template, title must also be into a template
+ * But for the moment we don't know if it'st possible as we keep a method available on overloaded objects.
+ *
+ * @param string $action Action code
+ * @param string $seller Object of seller third party
+ * @param string $buyer Object of buyer third party
+ * @param string $selected Object line selected
+ * @param int $dateSelector 1=Show also date range input fields
+ * @param HookManager $hookmanager Hookmanager
+ * @return void
+ */
+ function printObjectLines($action,$seller,$buyer,$selected=0,$dateSelector=0,$hookmanager=false)
+ {
+ global $conf,$langs;
+
+ print '<tr class="liste_titre nodrag nodrop">';
+ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
+ {
+ print '<td align="center" width="5">&nbsp;</td>';
+ }
+ print '<td>'.$langs->trans('Description').'</td>';
+ print '<td align="right" width="50">'.$langs->trans('VAT').'</td>';
+ print '<td align="right" width="80">'.$langs->trans('PriceUHT').'</td>';
+ print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
+ print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
+ print '<td align="right" width="50">'.$langs->trans('TotalHTShort').'</td>';
+ print '<td width="10">&nbsp;</td>';
+ print '<td width="10">&nbsp;</td>';
+ print '<td nowrap="nowrap">&nbsp;</td>'; // No width to allow autodim
+ print "</tr>\n";
+
+ $num = count($this->lines);
+ $var = true;
+ $i = 0;
+
+ foreach ($this->lines as $line)
+ {
+ $var=!$var;
+
+ if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
+ {
+ if (empty($line->fk_parent_line))
+ {
+ $parameters = array('line'=>$line,'var'=>$var,'num'=>$num,'i'=>$i,'dateSelector'=>$dateSelector,'seller'=>$seller,'buyer'=>$buyer,'selected'=>$selected);
+ $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
+ }
+ }
+ else
+ {
+ $this->printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected,$hookmanager);
+ }
+
+ $i++;
+ }
+ }
+
+ /**
+ * Return HTML content of a detail line
+ * TODO Move this into an output class file (htmlline.class.php)
+ * If lines are into a template, title must also be into a template
+ * But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
+ *
+ * @param string $action GET/POST action
+ * @param array $line Selected object line to output
+ * @param string $var Is it a an odd line (true)
+ * @param int $num Number of line (0)
+ * @param int $i I
+ * @param int $dateSelector 1=Show also date range input fields
+ * @param string $seller Object of seller third party
+ * @param string $buyer Object of buyer third party
+ * @param string $selected Object line selected
+ * @param HookManager $hookmanager Hook manager
+ * @return void
*/
function printObjectLine($action,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected=0,$hookmanager=false)
{
global $conf,$langs,$user;
global $form,$bc,$bcdd;
-
- $element = $this->element;
- if ($element == 'propal') $element = 'propale'; // To work with non standard path
-
- // Show product and description
- $type=$line->product_type?$line->product_type:$line->fk_product_type;
- // Try to enhance type detection using date_start and date_end for free lines where type
- // was not saved.
- if (! empty($line->date_start)) $type=1;
- if (! empty($line->date_end)) $type=1;
-
- // Ligne en mode visu
- if ($action != 'editline' || $selected != $line->id)
- {
- // Produit
- if ($line->fk_product > 0)
- {
- $product_static = new Product($this->db);
-
- // Define output language
- if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
- {
- $this->fetch_thirdparty();
- $prod = new Product($this->db, $line->fk_product);
-
- $outputlangs = $langs;
- $newlang='';
- if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
- if (empty($newlang)) $newlang=$this->client->default_lang;
- if (! empty($newlang))
- {
- $outputlangs = new Translate("",$conf);
- $outputlangs->setDefaultLang($newlang);
- }
-
- $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $line->product_label;
- }
- else {
- $label = $line->product_label;
- }
-
- $product_static->type=$line->fk_product_type;
- $product_static->id=$line->fk_product;
- $product_static->ref=$line->ref;
- $product_static->libelle=$label;
- $text=$product_static->getNomUrl(1);
- $text.= ' - '.$label;
- $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description));
-
- // Use global variables + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php');
- //include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductlinediv_view.tpl.php');
- }
- else
- {
- // Use global variables + $dateSelector + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_view.tpl.php');
- }
- }
-
- // Ligne en mode update
- if ($this->statut == 0 && $action == 'editline' && $selected == $line->id)
- {
- if ($line->fk_product > 0)
- {
- // Use global variables + $dateSelector + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php');
- }
- else
- {
- // Use global variables + $dateSelector + $seller and $buyer
- include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php');
- }
- }
- }
+
+ // Show product and description
+ $type=$line->product_type?$line->product_type:$line->fk_product_type;
+ // Try to enhance type detection using date_start and date_end for free lines where type
+ // was not saved.
+ if (! empty($line->date_start)) $type=1;
+ if (! empty($line->date_end)) $type=1;
+
+ // Ligne en mode visu
+ if ($action != 'editline' || $selected != $line->id)
+ {
+ // Produit
+ if ($line->fk_product > 0)
+ {
+ $product_static = new Product($this->db);
+
+ // Define output language
+ if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE))
+ {
+ $this->fetch_thirdparty();
+ $prod = new Product($this->db, $line->fk_product);
+
+ $outputlangs = $langs;
+ $newlang='';
+ if (empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
+ if (empty($newlang)) $newlang=$this->client->default_lang;
+ if (! empty($newlang))
+ {
+ $outputlangs = new Translate("",$conf);
+ $outputlangs->setDefaultLang($newlang);
+ }
+
+ $label = (! empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $line->product_label;
+ }
+ else
+ {
+ $label = $line->product_label;
+ }
+
+ $product_static->type=$line->fk_product_type;
+ $product_static->id=$line->fk_product;
+ $product_static->ref=$line->ref;
+ $product_static->libelle=$label;
+ $text=$product_static->getNomUrl(1);
+ $text.= ' - '.$label;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($line->description));
+
+ // Use global variables + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_view.tpl.php');
+ }
+ else
+ {
+ // Use global variables + $dateSelector + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_view.tpl.php');
+ }
+ }
+
+ // Ligne en mode update
+ if ($this->statut == 0 && $action == 'editline' && $selected == $line->id)
+ {
+ if ($line->fk_product > 0)
+ {
+ // Use global variables + $dateSelector + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/predefinedproductline_edit.tpl.php');
+ }
+ else
+ {
+ // Use global variables + $dateSelector + $seller and $buyer
+ include(DOL_DOCUMENT_ROOT.'/core/tpl/freeproductline_edit.tpl.php');
+ }
+ }
+ }
/* This is to show array of line of details of source object */
View
2  htdocs/core/class/html.formother.class.php
@@ -688,7 +688,7 @@ function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $
$currentyear = date("Y")+$offset;
$max_year = $currentyear+$max_year;
$min_year = $currentyear-$min_year;
- if(empty($selected)) $selected = $currentyear;
+ if(empty($selected) && empty($useempty)) $selected = $currentyear;
$out.= '<select class="flat" id="' . $htmlname . '" name="' . $htmlname . '"'.$option.' >';
if($useempty)
View
104 htdocs/core/tpl/predefinedproductlinediv_view.tpl.php
@@ -1,104 +0,0 @@
-<?php
-/* Copyright (C) 2010-2011 Regis Houssin <regis@dolibarr.fr>
- * Copyright (C) 2010-2011 Laurent Destailleur <eldy@users.sourceforge.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-?>
-
-<!-- BEGIN PHP TEMPLATE predefinedproductline_view.tpl.php -->
-
-<div class="tr pair" <?php echo 'id="row-'.$line->id.'"'; ?>>
- <div class="td firstcol">
- <div id="<?php echo $line->id; ?>"></div>
- <?php
- echo $form->textwithtooltip($text,$description,3,'','',$i,0,($line->fk_parent_line?img_picto('', 'rightarrow'):''));
-
- // Show range
- print_date_range($line->date_start, $line->date_end);
-
- // Add description in form
- if ($conf->global->PRODUIT_DESC_IN_FORM)
- {
- print ($line->description && $line->description!=$line->product_label)?'<br>'.dol_htmlentitiesbr($line->description):'';
- }
- ?>
- </div>
-
- <div class="td"><?php echo vatrate($line->tva_tx,'%',$line->info_bits); ?></div>
-
- <div class="td"><?php echo price($line->subprice); ?></div>
-
- <div class="td">
- <?php if ((($line->info_bits & 2) != 2) && $line->special_code != 3) echo $line->qty;
- else echo '&nbsp;'; ?>
- </div>
-
- <div class="td">
- <?php if (!empty($line->remise_percent) && $line->special_code != 3) {
- echo dol_print_reduction($line->remise_percent,$langs);
- } else {
- echo '&nbsp;';
- } ?>
- </div>
-
- <div class="td">
- <?php if ($line->special_code == 3) {
- echo $langs->trans('Option');
- } else {
- echo price($line->total_ht);
- } ?>
- </div>
-
- <?php if ($this->statut == 0 && $user->rights->$element->creer) { ?>
- <div class="td endcol">
- <?php if (($line->info_bits & 2) == 2) { ?>
- <?php } else { ?>
- <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=editline&amp;lineid='.$line->id.'#'.$line->id; ?>">
- <?php echo img_edit(); ?>
- </a>
- <?php } ?>
- </div>
-
- <div class="td endcol">
- <a href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=ask_deleteline&amp;lineid='.$line->id; ?>">
- <?php echo img_delete(); ?>
- </a>
- </div>
-
- <?php if ($num > 1) { ?>
- <div class="td end tdlineupdown">
- <?php if ($i > 0) { ?>
- <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=up&amp;rowid='.$line->id; ?>">
- <?php echo img_up(); ?>
- </a>
- <?php } ?>
- <?php if ($i < $num-1) { ?>
- <a class="lineupdown" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$this->id.'&amp;action=down&amp;rowid='.$line->id; ?>">
- <?php echo img_down(); ?>
- </a>
- <?php } ?>
- </div>
- <?php } else { ?>
- <div class="td endcol tdlineupdown">&nbsp;</div>
- <?php } ?>
-<?php } else { ?>
- <div class="td endcol">&nbsp;</div>
- <div class="td endcol">&nbsp;</div>
- <div class="td end">&nbsp;</div>
-<?php } ?>
-
-</div>
-<!-- END PHP TEMPLATE predefinedproductline_view.tpl.php -->

No commit comments for this range

Something went wrong with that request. Please try again.