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 "propalid."\">".img_object($langs->trans("ShowPropal"),"propal")." ".$obj->ref.""; - if ($obj->dp < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + print ""; + print ''; + + $propalstatic->id=$obj->propalid; + $propalstatic->ref=$obj->ref; + + print ''; + print ''; + + print ''; + + print '
'; + print $propalstatic->getNomUrl(1); + print ''; + if ($obj->dp < (time() - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + 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 ''; - $var=False; - while ($i < $num) - { - $objp = $db->fetch_object(); - print ""; - print ''; - print ''; - print ""; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - $i++; - $var=!$var; + $i = 0; + print '
'.$langs->trans("LastClosedProposals",$NBMAX).'
'; - print ''.img_object($langs->trans("ShowPropal"),"propal").' '; - print $objp->ref.''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).' "; - print dolibarr_print_date($objp->dp)."".price($objp->price)."".$propalstatic->LibStatut($objp->fk_statut,3)."
'; + print ''; + $var=False; + while ($i < $num) + { + $objp = $db->fetch_object(); + print ""; + print ''; + + print ''; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + $i++; + $var=!$var; - } + } - print "
'.$langs->trans("LastClosedProposals",$NBMAX).'
'; + + $propalstatic->id=$objp->propalid; + $propalstatic->ref=$objp->ref; + + print ''; + print ''; + + print ''; + + print '
'; + print $propalstatic->getNomUrl(1); + 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 '
'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'"; + print dolibarr_print_date($objp->dp)."".price($objp->price)."".$propalstatic->LibStatut($objp->fk_statut,3)."
"; - $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; + } }