From 19e1bd008306a98ee030837267f5ddc005d34508 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Feb 2009 15:00:34 +0000 Subject: [PATCH] Qual: Removed deprecated code --- htdocs/comm/fiche.php | 2 +- htdocs/comm/propal.php | 13 +- htdocs/commande/fiche.php | 72 ++-- htdocs/compta/propal.php | 759 ++++++++++++++++----------------- htdocs/expedition/commande.php | 53 +-- htdocs/html.form.class.php | 2 +- 6 files changed, 445 insertions(+), 456 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 6e4f513694e..c6626f0433c 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -297,7 +297,7 @@ if ($socid > 0) } // Adresse de livraison - if ($conf->expedition->enabled) + if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) { print ''; print ''; print ''; - + // Delivery date $langs->load('deliveries'); print '
'; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 42decca3fae..6d5df60a067 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -786,6 +786,7 @@ if ($_REQUEST['action'] == 'builddoc' && $user->rights->propale->creer) } } +// Set project if ($_POST['action'] == 'classin') { $propal = new Propal($db); @@ -1050,7 +1051,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; } - // Conditions et modes de reglement + // Payment term print '
'; @@ -1097,7 +1098,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; print ''; - // Mode paiement + // Payment mode print ''; print '
'; print $langs->trans('PaymentConditionsShort'); @@ -1116,7 +1117,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index f1999925d3e..236029b1532 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1184,7 +1184,7 @@ else /* * Commande */ - $nbrow=8; + $nbrow=7; if ($conf->projet->enabled) $nbrow++; print '
'; @@ -1142,9 +1143,9 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - if ($propal->statut == 0 && $user->rights->propale->creer) + if ($user->rights->propale->creer) { - if ($_GET['action'] != 'classer' && $propal->brouillon) print ''; + if ($_GET['action'] != 'classer') print ''; print '
'; print $langs->trans('Project').''.img_edit($langs->trans('SetProject')).''.img_edit($langs->trans('SetProject')).'
'; print '
'; if ($_GET['action'] == 'classer') @@ -1166,7 +1167,7 @@ if ($id > 0 || ! empty($ref)) $proj = new Project($db); $proj->fetch($propal->projetidp); print ''; - print $proj->title; + print $proj->ref; print ''; print '
'; @@ -1268,35 +1268,34 @@ else print ''; // Date de livraison - if ($conf->expedition->enabled) + print ''; - print ''; - print ''; - + print ''; + print ''; + $html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison"); + print ''; + print ''; + } + else + { + print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : ' '; + } + print ''; + print ''; + print ''; + if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) + { // Adresse de livraison print ''; + print '
'; + print ''; + + if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print ''; + print '
'; + print $langs->trans('DeliveryDate'); + print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'
'; + print '
'; + if ($_GET['action'] == 'editdate_livraison') { - print '
'; - print ''; - - if ($_GET['action'] != 'editdate_livraison' && $commande->brouillon) print ''; - print '
'; - print $langs->trans('DeliveryDate'); - print 'id.'">'.img_edit($langs->trans('SetDeliveryDate'),1).'
'; - print '
'; - if ($_GET['action'] == 'editdate_livraison') - { - print '
'; - print ''; - $html->select_date($commande->date_livraison,'liv_','','','',"setdate_livraison"); - print ''; - print '
'; - } - else - { - print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : ' '; - } - print '
'.$langs->trans('NotePublic').' :
'; - print nl2br($commande->note_public); - print '
'.$langs->trans('NotePublic').' :
'; + print nl2br($commande->note_public); + print '
'; print ''; - //Note public lorsque le module expedition n'est pas active - if (!$conf->projet->enabled) $nbrow--; - if (!$conf->expedition->enabled) - { - $nbrow--; - if ($conf->projet->enabled) $nbrow--; - print ''; - } - print ''; + + // Payment mode print ''; + } + else { + print ''; + } + } + print ''; + } + + // Amount + print ''; + print ''; + print ''; - // Amount - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - // Statut - print ''; - print '
'; @@ -1337,23 +1336,14 @@ else } print ''.$langs->trans('NotePublic').' :
'; - print nl2br($commande->note_public); - print '
'; print ''; - if ($_GET['action'] != 'editmode' && $commande->brouillon) print ''; + if ($_GET['action'] != 'editmode') print ''; print '
'; print $langs->trans('PaymentMode'); print 'id.'">'.img_edit($langs->trans('SetMode'),1).'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; print '
'; if ($_GET['action'] == 'editmode') @@ -1374,7 +1364,7 @@ else print ''; - if ($_GET['action'] != 'classer' && $commande->brouillon) print ''; + if ($_GET['action'] != 'classer') print ''; print '
'; print $langs->trans('Project'); print ''.img_edit($langs->trans('SetProject')).''.img_edit($langs->trans('SetProject')).'
'; print '
'; if ($_GET['action'] == 'classer') diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 026eaf77543..c1559f80118 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -25,7 +25,7 @@ \ingroup propale \brief Page liste des propales (vision compta) \version $Id$ -*/ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/html.formfile.class.php"); @@ -44,7 +44,7 @@ $sortfield=$_GET["sortfield"]; $viewstatut=$_GET['viewstatut']; $propal_statut = $_GET['propal_statut']; if($propal_statut != '') - $viewstatut=$propal_statut; +$viewstatut=$propal_statut; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.datep"; @@ -76,12 +76,10 @@ $result = restrictedArea($user, $module, $objectid, $dbtable); if ($_GET["action"] == 'setstatut') { - /* - * Class�e la facture comme factur�e - */ - $propal = new Propal($db); - $propal->id = $_GET["propalid"]; - $propal->cloture($user, $_GET["statut"], $note); + // Close proposal + $propal = new Propal($db); + $propal->id = $_GET["propalid"]; + $propal->cloture($user, $_GET["statut"], $note); } @@ -90,7 +88,7 @@ if ( $action == 'delete' ) $sql = "DELETE FROM ".MAIN_DB_PREFIX."propal WHERE rowid = $propalid;"; if ( $db->query($sql) ) { - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE fk_propal = $propalid ;"; if ( $db->query($sql) ) { @@ -109,6 +107,15 @@ if ( $action == 'delete' ) $brouillon = 1; } +// Set project +if ($_POST['action'] == 'classin') +{ + $propal = new Propal($db); + $propal->fetch($_GET['propalid']); + $propal->setProject($_POST['projetidp']); +} + + /* * View @@ -130,50 +137,50 @@ $propalstatic=new Propal($db); */ if ($_GET["propalid"] > 0) { - if ($mesg) print "$mesg
"; + if ($mesg) print "$mesg
"; - $propal = new Propal($db); - $propal->fetch($_GET['propalid']); - - $societe = new Societe($db); - $societe->fetch($propal->socid); + $propal = new Propal($db); + $propal->fetch($_GET['propalid']); - $head = propal_prepare_head($propal); - dolibarr_fiche_head($head, 'compta', $langs->trans('Proposal')); - - - /* - * Fiche propal - * - */ - print ''; + $societe = new Societe($db); + $societe->fetch($propal->socid); - $linkback=''.$langs->trans("BackToList").""; + $head = propal_prepare_head($propal); + dolibarr_fiche_head($head, 'compta', $langs->trans('Proposal')); - // Ref - print ''; - // Ref client - print ''; - print ''; - - $rowspan=8; - - // Soci�t� - print ''; + /* + * Fiche propal + * + */ + print '
'.$langs->trans('Ref').''; - print $html->showrefnav($propal,'propalid',$linkback); - print '
'; - print ''; - if ($_GET['action'] != 'refclient' && $propal->brouillon) print ''; - print '
'; - print $langs->trans('RefCustomer').''; - print ''.img_edit($langs->trans('Modify')).'
'; - print '
'; - print $propal->ref_client; - print '
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'; + + $linkback=''.$langs->trans("BackToList").""; + + // Ref + print ''; + + // Ref client + print ''; + print ''; + + $rowspan=8; + + // Soci�t� + print ''; // Ligne info remises tiers - print ''; - // Dates - print ''; + // Dates + print ''; - if ($conf->projet->enabled) $rowspan++; + if ($conf->projet->enabled) $rowspan++; // Note - print ''; - print ''; + print ''; + print ''; // Date fin propal print ''; - print ''; - print ''; + print ''; + print ''; - // Conditions et modes de r�glement + // Payment term print ''; - } - else { - print ''; - } - } - } - print ''; - } + // Project + if ($conf->projet->enabled) + { + $langs->load("projects"); + print ''; + } + else + { + print '
'.$langs->trans('Ref').''; + print $html->showrefnav($propal,'propalid',$linkback); + print '
'; + print ''; + if ($_GET['action'] != 'refclient' && $propal->brouillon) print ''; + print '
'; + print $langs->trans('RefCustomer').''; + print ''.img_edit($langs->trans('Modify')).'
'; + print '
'; + print $propal->ref_client; + print '
'.$langs->trans('Company').''.$societe->getNomUrl(1).'
'.$langs->trans('Discounts').''; + print '
'.$langs->trans('Discounts').''; if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$societe->getAvailableDiscounts(); @@ -183,33 +190,33 @@ if ($_GET["propalid"] > 0) print '.'; print '
'.$langs->trans('Date').''; - print dolibarr_print_date($propal->date,'daytext'); - print '
'.$langs->trans('Date').''; + print dolibarr_print_date($propal->date,'daytext'); + print ''.$langs->trans('NotePublic').' :
'. nl2br($propal->note_public).'
'.$langs->trans('NotePublic').' :
'. nl2br($propal->note_public).'
'.$langs->trans('DateEndPropal').''; - if ($propal->fin_validite) - { - print dolibarr_print_date($propal->fin_validite,'daytext'); - if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - } - else - { - print $langs->trans("Unknown"); - } - print '
'.$langs->trans('DateEndPropal').''; + if ($propal->fin_validite) + { + print dolibarr_print_date($propal->fin_validite,'daytext'); + if ($propal->statut == 1 && $propal->fin_validite < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + } + else + { + print $langs->trans("Unknown"); + } + print '
'; print ''; - // Mode de paiement + // Payment mode print ''; print ''; - } - else - { - print '
'; print $langs->trans('PaymentConditionsShort'); @@ -227,7 +234,7 @@ if ($_GET["propalid"] > 0) } print '
'; print ''; - // Projet - if ($conf->projet->enabled) - { - $langs->load("projects"); - print ''; - } - else - { - if ($propal->statut == 0 && $user->rights->propale->creer) - { - if ($_GET['action'] != 'classer' && $propal->brouillon) print ''; - print '
'; @@ -246,142 +253,130 @@ if ($_GET["propalid"] > 0) } print '
'; - print ''; - $numprojet = $societe->has_projects(); - if (! $numprojet) - { - print '
'; - print $langs->trans('Project').'
'; - print '
'; - print $langs->trans("NoProject").''; - print 'id.'&action=create>'.$langs->trans('AddProject').''; - print ''.img_edit($langs->trans('SetProject')).'
'; - print '
'; - if ($_GET['action'] == 'classer') - { - $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'projetidp'); - } - else - { - $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'none'); - } - print '
'; - if (!empty($propal->projetidp)) - { - print '
'; - $proj = new Project($db); - $proj->fetch($propal->projetidp); - print ''; - print $proj->title; - print ''; - print ' 
'; + print ''; + if (1 == 2 && $user->rights->propale->creer) + { + if ($_GET['action'] != 'classer') print ''; + print '
'; + print $langs->trans('Project').''.img_edit($langs->trans('SetProject')).'
'; + print '
'; + if ($_GET['action'] == 'classer') + { + $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'projetidp'); + } + else + { + $html->form_project($_SERVER['PHP_SELF'].'?propalid='.$propal->id, $propal->socid, $propal->projetidp, 'none'); + } + print '
'; + if (!empty($propal->projetidp)) + { + print '
'; + $proj = new Project($db); + $proj->fetch($propal->projetidp); + print ''; + print $proj->ref; + print ''; + print ' 
'.$langs->trans('AmountHT').''.price($propal->total_ht).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountHT').''.price($propal->total_ht).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($propal->total_tva).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($propal->total_ttc).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($propal->total_tva).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($propal->total_ttc).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('Status').''.$propal->getLibStatut(4).'

'; + // Statut + print '
'.$langs->trans('Status').''.$propal->getLibStatut(4).'

'; - /* - * Lignes de propale - * - */ - print ''; - - $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.fk_remise_except,'; - $sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; - $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc,'; - $sql.= ' p.rowid as prodid, p.label as product, p.ref, p.fk_product_type, '; - $sql.= ' p.description as product_desc'; - $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; - $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; - $sql.= ' WHERE pt.fk_propal = '.$propal->id; - $sql.= ' ORDER BY pt.rang ASC, pt.rowid'; - $resql = $db->query($sql); - if ($resql) - { - $num_lignes = $db->num_rows($resql); - $i = 0; - $total = 0; - - if ($num_lignes) - { - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + /* + * Lignes de propale + * + */ + print '
'.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').''.$langs->trans('AmountHT').'  
'; + + $sql = 'SELECT pt.rowid, pt.description, pt.price, pt.fk_product, pt.fk_remise_except,'; + $sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,'; + $sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc,'; + $sql.= ' p.rowid as prodid, p.label as product, p.ref, p.fk_product_type, '; + $sql.= ' p.description as product_desc'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'propaldet as pt'; + $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pt.fk_product=p.rowid'; + $sql.= ' WHERE pt.fk_propal = '.$propal->id; + $sql.= ' ORDER BY pt.rang ASC, pt.rowid'; + $resql = $db->query($sql); + if ($resql) + { + $num_lignes = $db->num_rows($resql); + $i = 0; + $total = 0; + + if ($num_lignes) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; - print "\n"; - } - $var=true; - while ($i < $num_lignes) - { - $objp = $db->fetch_object($resql); - $var=!$var; - if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) - { - print ''; - if ($objp->fk_product > 0) - { - print ''; - } + print ''; + print ''; + print "\n"; + } + $var=true; + while ($i < $num_lignes) + { + $objp = $db->fetch_object($resql); + $var=!$var; + if ($_GET['action'] != 'editline' || $_GET['rowid'] != $objp->rowid) + { + print ''; + if ($objp->fk_product > 0) + { + print ''; + } else { print '\n"; } - print ''; - print '\n"; + print ''; + print '\n"; // Qty print ''; - if ($objp->remise_percent > 0) - { - print '\n"; - } - else - { - print ''; - } - print '\n"; + if ($objp->remise_percent > 0) + { + print '\n"; + } + else + { + print ''; + } + print '\n"; print ''; - print ''; - } + print ''; + } - $i++; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } + $i++; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } + + print '
'.$langs->trans('Description').''.$langs->trans('VAT').''.$langs->trans('PriceUHT').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').''.$langs->trans('AmountHT').' 
'; - if ($objp->fk_product_type==1) - print img_object($langs->trans('ShowService'),'service'); - else - print img_object($langs->trans('ShowProduct'),'product'); - print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product)); - if ($objp->date_start && $objp->date_end) - { - print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; - } - if ($objp->date_start && ! $objp->date_end) - { - print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; - } - if (! $objp->date_start && $objp->date_end) - { - print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; - } - print ($objp->description && $objp->description!=$objp->product)?'
'.stripslashes(nl2br($objp->description)):''; - print '
  
'; + if ($objp->fk_product_type==1) + print img_object($langs->trans('ShowService'),'service'); + else + print img_object($langs->trans('ShowProduct'),'product'); + print ' '.$objp->ref.' - '.stripslashes(nl2br($objp->product)); + if ($objp->date_start && $objp->date_end) + { + print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')'; + } + if ($objp->date_start && ! $objp->date_end) + { + print ' (A partir du '.dolibarr_print_date($objp->date_start).')'; + } + if (! $objp->date_start && $objp->date_end) + { + print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')'; + } + print ($objp->description && $objp->description!=$objp->product)?'
'.stripslashes(nl2br($objp->description)):''; + print '
'; @@ -423,8 +418,8 @@ if ($_GET["propalid"] > 0) } print "'.vatrate($objp->tva_tx).'%'.price($objp->subprice)."'.vatrate($objp->tva_tx).'%'.price($objp->subprice)."'; @@ -435,74 +430,74 @@ if ($_GET["propalid"] > 0) else print ' '; print ''.$objp->remise_percent."% '.price($objp->total_ht)."'.$objp->remise_percent."% '.price($objp->total_ht)." 
'; + + + print ''; - print '
'; - - - print ''; - /* - * Boutons Actions - */ - print '
'; - + * Boutons Actions + */ + print '
'; + if ($propal->statut <> 4 && $user->societe_id == 0) { if ($propal->statut == 2 && $user->rights->facture->creer) { print '".$langs->trans("BuildBill").""; } - + $arraypropal=$propal->getInvoiceArrayList(); if ($propal->statut == 2 && is_array($arraypropal) && sizeof($arraypropal) > 0) { print '".$langs->trans("ClassifyBilled").""; } } - print "
"; - print "
\n"; - + print "
"; + print "
\n"; + print ''; print ''; print "\n"; - + require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); $staticfacture=new Facture($db); - + $var=True; while ($i < $num_fac_asso) { @@ -627,80 +622,80 @@ if ($_GET["propalid"] > 0) } - print '
'; - /* - * Documents g�n�r�s - */ - $filename=sanitizeFileName($propal->ref); - $filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); - $urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id; - $genallowed=0; - $delallowed=0; - - $var=true; - - $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed); - + /* + * Documents g�n�r�s + */ + $filename=sanitizeFileName($propal->ref); + $filedir=$conf->propal->dir_output . "/" . sanitizeFileName($propal->ref); + $urlsource=$_SERVER["PHP_SELF"]."?propalid=".$propal->id; + $genallowed=0; + $delallowed=0; + + $var=true; + + $somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed); + /* * Commandes rattach�es @@ -539,7 +534,7 @@ if ($_GET["propalid"] > 0) } } - + /* * Factures associees */ @@ -556,37 +551,37 @@ if ($_GET["propalid"] > 0) $sql2.= " WHERE cp.fk_propale = ".$propal->id." AND cf.fk_commande = cp.fk_commande AND cf.fk_facture = f.rowid"; dolibarr_syslog("propal.php::liste factures sql=".$sql); - $resql=$db->query($sql); + $resql=$db->query($sql); $resql2=null; - if ($resql) - { - dolibarr_syslog("propal.php::liste factures sql2=".$sql2); - $resql2=$db->query($sql2); - } + if ($resql) + { + dolibarr_syslog("propal.php::liste factures sql2=".$sql2); + $resql2=$db->query($sql2); + } if ($resql2) - { + { $tab_sqlobj=array(); - - $num_fac_asso = $db->num_rows($resql); + + $num_fac_asso = $db->num_rows($resql); for ($i = 0;$i < $num_fac_asso;$i++) - { + { $sqlobj = $db->fetch_object($resql); $tab_sqlobj[] = $sqlobj; //$tab_sqlobjOrder[]= $sqlobj->dc; - } - $db->free($resql); - + } + $db->free($resql); + $num_fac_asso = $db->num_rows($resql2); for ($i = 0;$i < $num_fac_asso;$i++) - { + { $sqlobj = $db->fetch_object($resql2); $tab_sqlobj[] = $sqlobj; //$tab_sqlobjOrder[]= $sqlobj->dc; - } + } $db->free($resql2); - + //array_multisort ($tab_sqlobjOrder,$tab_sqlobj); - + $num_fac_asso = sizeOf($tab_sqlobj); //$num_fac_asso = $db->num_rows($resql); $i = 0; $total = 0; @@ -600,10 +595,10 @@ if ($_GET["propalid"] > 0) print ''.$langs->trans("Price").''.$langs->trans("Status").'
'; + print ''; // List of actions on element include_once(DOL_DOCUMENT_ROOT.'/html.formactions.class.php'); $formactions=new FormActions($db); $somethingshown=$formactions->showactions($propal,'propal',$socid); - print '
'; - - + print '
'; + + } else { - /** - * - * Mode Liste des propales - * - */ + /** + * + * Mode Liste des propales + * + */ $now=gmmktime(); - $limit = $conf->liste_limit; - $offset = $limit * $page ; - $pageprev = $page - 1; - $pagenext = $page + 1; + $limit = $conf->liste_limit; + $offset = $limit * $page ; + $pageprev = $page - 1; + $pagenext = $page + 1; - $year = $_REQUEST["year"]; - $month = $_REQUEST["month"]; + $year = $_REQUEST["year"]; + $month = $_REQUEST["month"]; - $sql = "SELECT s.nom, s.rowid as socid, s.client,"; - $sql.= " p.rowid as propalid, p.ref, p.fk_statut,"; - $sql.= " p.total_ht, p.tva, p.total,"; - $sql.= $db->pdate("p.datep")." as dp, "; - $sql.= $db->pdate("p.fin_validite")." as dfin"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; - $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"; - $sql.= " WHERE p.fk_soc = s.rowid"; - if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) $sql .= " AND s.rowid = ".$socid; - if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons s�par� par virgules - if ($month > 0) - { - if ($year > 0) - $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; - else - $sql .= " AND date_format(p.datep, '%m') = '$month'"; - } - if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year"; - if (!empty($_GET['search_ref'])) - { - $sql .= " AND p.ref LIKE '%".addslashes($_GET['search_ref'])."%'"; - } - if (!empty($_GET['search_societe'])) - { - $sql .= " AND s.nom LIKE '%".addslashes($_GET['search_societe'])."%'"; - } - if (!empty($_GET['search_montant_ht'])) - { - $sql .= " AND p.price='".addslashes($_GET['search_montant_ht'])."'"; - } - $sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC "; - $sql .= $db->plimit($limit + 1,$offset); + $sql = "SELECT s.nom, s.rowid as socid, s.client,"; + $sql.= " p.rowid as propalid, p.ref, p.fk_statut,"; + $sql.= " p.total_ht, p.tva, p.total,"; + $sql.= $db->pdate("p.datep")." as dp, "; + $sql.= $db->pdate("p.fin_validite")." as dfin"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; + $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"; + $sql.= " WHERE p.fk_soc = s.rowid"; + if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql .= " AND s.rowid = ".$socid; + if ($viewstatut <> '') $sql .= " AND p.fk_statut in ($viewstatut)"; // viewstatut peut etre combinaisons s�par� par virgules + if ($month > 0) + { + if ($year > 0) + $sql .= " AND date_format(p.datep, '%Y-%m') = '$year-$month'"; + else + $sql .= " AND date_format(p.datep, '%m') = '$month'"; + } + if ($year > 0) $sql .= " AND date_format(p.datep, '%Y') = $year"; + if (!empty($_GET['search_ref'])) + { + $sql .= " AND p.ref LIKE '%".addslashes($_GET['search_ref'])."%'"; + } + if (!empty($_GET['search_societe'])) + { + $sql .= " AND s.nom LIKE '%".addslashes($_GET['search_societe'])."%'"; + } + if (!empty($_GET['search_montant_ht'])) + { + $sql .= " AND p.price='".addslashes($_GET['search_montant_ht'])."'"; + } + $sql .= " ORDER BY $sortfield $sortorder, p.rowid DESC "; + $sql .= $db->plimit($limit + 1,$offset); if ( $result = $db->query($sql) ) { $num = $db->num_rows(); - - + + print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socid=$socid&month=$month&year=$year&search_ref=$search_ref&search_societe=$search_societe&search_montant_ht=$search_montant_ht".'&viewstatut='.$viewstatut,$sortfield,$sortorder,'',$num); - + $i = 0; $var=true; - + print ""; print ''; print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'width=20%',$sortfield,$sortorder); @@ -708,71 +703,71 @@ else print_liste_field_titre($langs->trans("Date"),"propal.php","p.datep","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountHT"),"propal.php","p.price","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),"propal.php","p.fk_statut","&viewstatut=$viewstatut","",'align="right"',$sortfield,$sortorder); - print ''; + print ''; print "\n"; - - // Lignes des champs de filtre - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - print ''; - + + // Lignes des champs de filtre + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + print ''; + while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); - + $var=!$var; print ""; print '\n"; - + // Societe print ""; - + // Date print "\n"; - + // Prix print "\n"; print "\n"; print ""; - print "\n"; - + print "\n"; + $i++; } - - print "
  
'; - print ''; - print ''; - print ''; - print ''; - print $langs->trans('Month').': '; - print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); - $syear = $year; - if($syear == '') - $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); - print ''; - print ''; - print ''; - $html->select_propal_statut($viewstatut); - print ''; - print '
'; + print ''; + print ''; + print ''; + print ''; + print $langs->trans('Month').': '; + print ' '.$langs->trans('Year').': '; + $max_year = date("Y"); + $syear = $year; + if($syear == '') + $syear = date("Y"); + $html->select_year($syear,'year',1, '', $max_year); + print ''; + print ''; + print ''; + $html->select_propal_statut($viewstatut); + print ''; + print '
'; - - $propalstatic->id=$objp->propalid; - $propalstatic->ref=$objp->ref; - - //Ref - print ''; - print ''; - - print ''; - - print '
'; - print $propalstatic->getNomUrl(1, 'compta', "&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder"); - print ''; - if ($objp->fk_statut == 1 && $objp->din < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); - print ''; - - $filename=sanitizeFileName($objp->ref); - $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); - $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); - - print '
'; - + + $propalstatic->id=$objp->propalid; + $propalstatic->ref=$objp->ref; + + //Ref + print ''; + print ''; + + print ''; + + print '
'; + print $propalstatic->getNomUrl(1, 'compta', "&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder"); + print ''; + if ($objp->fk_statut == 1 && $objp->din < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); + print ''; + + $filename=sanitizeFileName($objp->ref); + $filedir=$conf->propal->dir_output . '/' . sanitizeFileName($objp->ref); + $urlsource=$_SERVER['PHP_SELF'].'?propalid='.$objp->propalid; + $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','','','',1); + + print '
'; + print "
"; $societestatic->nom=$objp->nom; @@ -780,7 +775,7 @@ else $societestatic->client=$objp->client; print $societestatic->getNomUrl(1,'customer',44); print ""; $y = dolibarr_print_date($objp->dp,"%Y"); @@ -792,18 +787,18 @@ else print $b."\n"; print " "; print $y."".price($objp->total_ht)."".$propalstatic->LibStatut($objp->fk_statut,5)." 
"; - $db->free($result); + + print "
"; + $db->free($result); } else { diff --git a/htdocs/expedition/commande.php b/htdocs/expedition/commande.php index 2d2e219f2ad..f9aa6871123 100644 --- a/htdocs/expedition/commande.php +++ b/htdocs/expedition/commande.php @@ -45,7 +45,7 @@ $langs->load('stocks'); if (!$user->rights->commande->lire) accessforbidden(); -// Sécurité accés client +// S�curit� acc�s client if ($user->societe_id > 0) { $action = ''; @@ -148,12 +148,12 @@ if ($id > 0 || ! empty($ref)) */ if ($_GET["action"] == 'cloture') { - $html->form_confirm("commande.php?id=".$_GET["id"],"Clôturer la commande","Etes-vous sûr de vouloir clôturer cette commande ?","confirm_cloture"); + $html->form_confirm("commande.php?id=".$_GET["id"],"Cl�turer la commande","Etes-vous s�r de vouloir cl�turer cette commande ?","confirm_cloture"); print "
"; } // Onglet commande - $nbrow=8; + $nbrow=7; if ($conf->projet->enabled) $nbrow++; print ''; @@ -262,27 +262,30 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - // Adresse de livraison - print ''; } - else - { - $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id); - } - print ''; - - // Conditions et modes de réglement + + // Conditions et modes de r�glement print '
'; - print ''; - - if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print ''; - print '
'; - print $langs->trans('DeliveryAddress'); - print 'socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'
'; - print '
'; - - if ($_GET['action'] == 'editdelivery_adress') + if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) { - $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); + // Adresse de livraison + print '
'; + print ''; + + if ($_GET['action'] != 'editdelivery_adress' && $commande->brouillon) print ''; + print '
'; + print $langs->trans('DeliveryAddress'); + print 'socid.'&id='.$commande->id.'">'.img_edit($langs->trans('SetDeliveryAddress'),1).'
'; + print '
'; + + if ($_GET['action'] == 'editdelivery_adress') + { + $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'adresse_livraison_id','commande',$commande->id); + } + else + { + $html->form_adresse_livraison($_SERVER['PHP_SELF'].'?id='.$commande->id,$commande->adresse_livraison_id,$_GET['socid'],'none','commande',$commande->id); + } + print '
'; print '
'; print $langs->trans('PaymentConditionsShort'); @@ -363,8 +366,8 @@ if ($id > 0 || ! empty($ref)) /** - * Lignes de commandes avec quantité livrées et reste à livrer - * Les quantités livrées sont stockées dans $commande->expeditions[fk_product] + * Lignes de commandes avec quantit� livr�es et reste � livrer + * Les quantit�s livr�es sont stock�es dans $commande->expeditions[fk_product] */ print ''; @@ -595,7 +598,7 @@ if ($id > 0 || ! empty($ref)) } else { - /* Commande non trouvée */ + /* Commande non trouv�e */ print "Commande inexistante"; } } diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 578cb72b766..0ecf606ccb9 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -1614,7 +1614,7 @@ class Form $projet = new Project($this->db); $projet->fetch($selected); //print ''.$projet->title.''; - print $projet->getNomUrl(1); + print $projet->getNomUrl(0); } else { print " "; }