diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index fab4cef530c..97e897489bf 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -84,6 +84,8 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark')
* Affichage page
*/
+$html = new Form($db);
+
llxHeader();
print_fiche_titre($langs->trans("CommercialArea"));
@@ -572,8 +574,30 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
{
$obj = $db->fetch_object($result);
$var=!$var;
- print "
";
+ print '';
+
+ $propalstatic->id=$obj->propalid;
+ $propalstatic->ref=$obj->ref;
+
+ print '';
+ print '| ';
+ print $propalstatic->getNomUrl(1);
+ print ' | ';
+
+ print '';
+ if ($obj->dp < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late"));
+ print ' | ';
+
+ print '';
+
+ $filename=sanitize_string($obj->ref);
+ $filedir=$conf->propal->dir_output . '/' . sanitize_string($obj->ref);
+ $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$obj->propalid;
+ $html->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
+
+ print ' | ';
+
print " | ";
print "rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,44)." | \n";
print "";
@@ -618,35 +642,56 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
$sql .= $db->plimit($NBMAX, 0);
if ( $db->query($sql) )
- {
- $num = $db->num_rows();
+ {
+ $num = $db->num_rows();
- $i = 0;
- print '';
- print '| '.$langs->trans("LastClosedProposals",$NBMAX).' | ';
- $var=False;
- while ($i < $num)
- {
- $objp = $db->fetch_object();
- print "";
- print '| ';
- print ''.img_object($langs->trans("ShowPropal"),"propal").' ';
- print $objp->ref.' | ';
- print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).' | ';
- print " | ";
- print "";
- print dolibarr_print_date($objp->dp)." | \n";
- print "".price($objp->price)." | \n";
- print "".$propalstatic->LibStatut($objp->fk_statut,3)." | \n";
- print " \n";
- $i++;
- $var=!$var;
+ $i = 0;
+ print '';
+ print '| '.$langs->trans("LastClosedProposals",$NBMAX).' | ';
+ $var=False;
+ while ($i < $num)
+ {
+ $objp = $db->fetch_object();
+ print "";
+ print '';
+
+ $propalstatic->id=$objp->propalid;
+ $propalstatic->ref=$objp->ref;
+
+ print '';
+ print '| ';
+ print $propalstatic->getNomUrl(1);
+ print ' | ';
+
+ print '';
+ print ' ';
+ print ' | ';
+
+ print '';
+
+ $filename=sanitize_string($objp->ref);
+ $filedir=$conf->propal->dir_output . '/' . sanitize_string($objp->ref);
+ $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid;
+ $html->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1);
+
+ print ' | ';
+
+ print ' | ';
+
+ print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).' | ';
+ print "";
+ print dolibarr_print_date($objp->dp)." | \n";
+ print "".price($objp->price)." | \n";
+ print "".$propalstatic->LibStatut($objp->fk_statut,3)." | \n";
+ print " \n";
+ $i++;
+ $var=!$var;
- }
+ }
- print " ";
- $db->free();
- }
+ print " ";
+ $db->free();
+ }
}
diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php
index 73901346ed7..4c2f02bb553 100644
--- a/htdocs/propal.class.php
+++ b/htdocs/propal.class.php
@@ -2131,6 +2131,30 @@ class Propal extends CommonObject
return "";
}
}
+
+ /**
+ \brief Renvoie nom clicable (avec eventuellement le picto)
+ \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
+ \param option Sur quoi pointe le lien
+ \return string Chaine avec URL
+ */
+ function getNomUrl($withpicto=0,$option='')
+ {
+ global $langs;
+
+ $result='';
+
+ $lien = '';
+ $lienfin='';
+
+ $picto='order';
+ $label=$langs->trans("ShowPropal").': '.$this->ref;
+
+ if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
+ if ($withpicto && $withpicto != 2) $result.=' ';
+ $result.=$lien.$this->ref.$lienfin;
+ return $result;
+ }
}
|