Uniformize code

This commit is contained in:
Laurent Destailleur 2015-11-28 20:25:50 +01:00
parent 5d5cfd498a
commit 5df193ec93
10 changed files with 91 additions and 57 deletions

View File

@ -97,7 +97,12 @@ if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
// Search contract // Search contract
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{ {
$listofsearchfields['search_contract']=array('text'=>'Contrat'); $listofsearchfields['search_contract']=array('text'=>'Contrat');
}
// Search contract
if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire)
{
$listofsearchfields['search_supplier_proposal']=array('text'=>'SupplierProposalShort');
} }
if (count($listofsearchfields)) if (count($listofsearchfields))

View File

@ -74,6 +74,11 @@ if (GETPOST('search_supplier_invoice') != '')
header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode(GETPOST('search_supplier_invoice'))); header("Location: ".DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode(GETPOST('search_supplier_invoice')));
exit; exit;
} }
if (GETPOST('search_supplier_proposal') != '')
{
header("Location: ".DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode(GETPOST('search_supplier_proposal')));
exit;
}
if (GETPOST('search_donation') != '') if (GETPOST('search_donation') != '')
{ {
header("Location: ".DOL_URL_ROOT.'/don/list.php?sall='.urlencode(GETPOST('search_donation'))); header("Location: ".DOL_URL_ROOT.'/don/list.php?sall='.urlencode(GETPOST('search_donation')));

View File

@ -150,7 +150,7 @@ class InterfaceDemo extends DolibarrTriggers
case 'LINEPROPAL_UPDATE': case 'LINEPROPAL_UPDATE':
case 'LINEPROPAL_DELETE': case 'LINEPROPAL_DELETE':
// Askpricesupplier // SupplierProposal
case 'SUPPLIER_PROPOSAL_CREATE': case 'SUPPLIER_PROPOSAL_CREATE':
case 'SUPPLIER_PROPOSAL_CLONE': case 'SUPPLIER_PROPOSAL_CLONE':
case 'SUPPLIER_PROPOSAL_MODIFY': case 'SUPPLIER_PROPOSAL_MODIFY':

View File

@ -131,7 +131,7 @@ if ($resql)
{ {
print '<tr class="impair"><td align="center" colspan="2">'; print '<tr class="impair"><td align="center" colspan="2">';
$data=array('series'=>$dataseries); $data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); dol_print_graph('stats',300,180,$data,1,'pie',1,'',0);
print '</td></tr>'; print '</td></tr>';
} }
//if ($totalinprocess != $total) //if ($totalinprocess != $total)

View File

@ -11,10 +11,12 @@ DraftRequests=Draft requests
LastModifiedRequests=Last %s modified price requests LastModifiedRequests=Last %s modified price requests
RequestsOpened=Open price requests RequestsOpened=Open price requests
SupplierProposalArea=Supplier proposals area SupplierProposalArea=Supplier proposals area
Askpricesupplier=Supplier proposals SupplierProposal=Supplier proposal
SupplierProposalShort=Supplier proposal
SupplierProposals=Supplier proposals
NewAskPrice=New price request NewAskPrice=New price request
NewAsk=New request NewAsk=New request
ShowAskpricesupplier=Show price request ShowSupplierProposal=Show price request
AddSupplierProposal=Create a price request AddSupplierProposal=Create a price request
SupplierProposalRefFourn=Supplier ref SupplierProposalRefFourn=Supplier ref
SupplierProposalDate=Delivery date SupplierProposalDate=Delivery date
@ -25,22 +27,22 @@ DateAsk=Date of request
DeleteAsk=Delete request DeleteAsk=Delete request
ValidateAsk=Validate request ValidateAsk=Validate request
AddAsk=Create a request AddAsk=Create a request
AskpricesupplierDraft=Drafts SupplierProposalDraft=Drafts
AskpricesupplierOpened=Open SupplierProposalOpened=Open
AskpricesupplierStatusDraft=Draft (needs to be validated) SupplierProposalStatusDraft=Draft (needs to be validated)
AskpricesupplierStatusValidated=Validated (request is open) SupplierProposalStatusValidated=Validated (request is open)
AskpricesupplierStatusOpened=Validated (request is open) SupplierProposalStatusOpened=Validated (request is open)
AskpricesupplierStatusClosed=Closed SupplierProposalStatusClosed=Closed
AskpricesupplierStatusSigned=Accepted SupplierProposalStatusSigned=Accepted
AskpricesupplierStatusNotSigned=Refused SupplierProposalStatusNotSigned=Refused
AskpricesupplierStatusBilled=Billed SupplierProposalStatusBilled=Billed
AskpricesupplierStatusDraftShort=Draft SupplierProposalStatusDraftShort=Draft
AskpricesupplierStatusValidatedShort=Validated SupplierProposalStatusValidatedShort=Validated
AskpricesupplierStatusOpenedShort=Open SupplierProposalStatusOpenedShort=Open
AskpricesupplierStatusClosedShort=Closed SupplierProposalStatusClosedShort=Closed
AskpricesupplierStatusSignedShort=Accepted SupplierProposalStatusSignedShort=Accepted
AskpricesupplierStatusNotSignedShort=Refused SupplierProposalStatusNotSignedShort=Refused
AskpricesupplierStatusBilledShort=Billed SupplierProposalStatusBilledShort=Billed
CopyAskFrom=Create price request by copying existing a request CopyAskFrom=Create price request by copying existing a request
CreateEmptyAsk=Create blank request CreateEmptyAsk=Create blank request
CloneAsk=Clone price request CloneAsk=Clone price request

View File

@ -11,10 +11,10 @@ DraftRequests=Demandes brouillons
LastModifiedRequests=Les %s dernières demandes de prix modifiées LastModifiedRequests=Les %s dernières demandes de prix modifiées
RequestsOpened=Demandes de prix ouvertes RequestsOpened=Demandes de prix ouvertes
SupplierProposalArea=Espace des demandes de prix fournisseurs SupplierProposalArea=Espace des demandes de prix fournisseurs
Askpricesupplier=Demande de prix fournisseur SupplierProposal=Demande de prix fournisseur
NewAskPrice=Nouvelle demande de prix NewAskPrice=Nouvelle demande de prix
NewAsk=Nouvelle demande NewAsk=Nouvelle demande
ShowAskpricesupplier=Afficher la demande de prix ShowSupplierProposal=Afficher la demande de prix
AddSupplierProposal=Créer une demande de prix AddSupplierProposal=Créer une demande de prix
SupplierProposalRefFourn=Réf. fournisseur SupplierProposalRefFourn=Réf. fournisseur
SupplierProposalDate=Date de livraison SupplierProposalDate=Date de livraison
@ -25,20 +25,20 @@ DateAsk=Date de demande
DeleteAsk=Supprimer demande DeleteAsk=Supprimer demande
ValidateAsk=Valider demande ValidateAsk=Valider demande
AddAsk=Créer une demande AddAsk=Créer une demande
AskpricesupplierDraft=Brouillons SupplierProposalDraft=Brouillons
AskpricesupplierOpened=Ouvertes SupplierProposalOpened=Ouvertes
AskpricesupplierStatusDraft=Brouillon (à valider) SupplierProposalStatusDraft=Brouillon (à valider)
AskpricesupplierStatusValidated=Validée (demande ouverte) SupplierProposalStatusValidated=Validée (demande ouverte)
AskpricesupplierStatusOpened=Validée (demande ouverte) SupplierProposalStatusOpened=Validée (demande ouverte)
AskpricesupplierStatusClosed=Fermée SupplierProposalStatusClosed=Fermée
AskpricesupplierStatusSigned=Acceptée SupplierProposalStatusSigned=Acceptée
AskpricesupplierStatusNotSigned=Refusée SupplierProposalStatusNotSigned=Refusée
AskpricesupplierStatusDraftShort=Brouillon SupplierProposalStatusDraftShort=Brouillon
AskpricesupplierStatusValidatedShort=Validée SupplierProposalStatusValidatedShort=Validée
AskpricesupplierStatusOpenedShort=Ouverte SupplierProposalStatusOpenedShort=Ouverte
AskpricesupplierStatusClosedShort=Fermée SupplierProposalStatusClosedShort=Fermée
AskpricesupplierStatusSignedShort=Acceptée SupplierProposalStatusSignedShort=Acceptée
AskpricesupplierStatusNotSignedShort=Refusée SupplierProposalStatusNotSignedShort=Refusée
CopyAskFrom=Créer demande/devis par recopie d'une demande existante CopyAskFrom=Créer demande/devis par recopie d'une demande existante
CreateEmptyAsk=Créer demande/devis vierge CreateEmptyAsk=Créer demande/devis vierge
CloneAsk=Cloner demande de prix CloneAsk=Cloner demande de prix

View File

@ -1607,8 +1607,8 @@ if ($action == 'create')
$form_close .= '<input type="hidden" name="action" value="setstatut">'; $form_close .= '<input type="hidden" name="action" value="setstatut">';
$form_close .= '<select id="statut" name="statut" class="flat">'; $form_close .= '<select id="statut" name="statut" class="flat">';
$form_close .= '<option value="0">&nbsp;</option>'; $form_close .= '<option value="0">&nbsp;</option>';
$form_close .= '<option value="2">' . $langs->trans('AskpricesupplierStatusSigned') . '</option>'; $form_close .= '<option value="2">' . $langs->trans('SupplierProposalStatusSigned') . '</option>';
$form_close .= '<option value="3">' . $langs->trans('AskpricesupplierStatusNotSigned') . '</option>'; $form_close .= '<option value="3">' . $langs->trans('SupplierProposalStatusNotSigned') . '</option>';
$form_close .= '</select>'; $form_close .= '</select>';
$form_close .= '</td></tr>'; $form_close .= '</td></tr>';
$form_close .= '<tr><td width="150" align="left">' . $langs->trans('Note') . '</td><td align="left"><textarea cols="70" rows="' . ROWS_3 . '" wrap="soft" name="note">'; $form_close .= '<tr><td width="150" align="left">' . $langs->trans('Note') . '</td><td align="left"><textarea cols="70" rows="' . ROWS_3 . '" wrap="soft" name="note">';

View File

@ -151,16 +151,16 @@ class SupplierProposal extends CommonObject
$this->remise_absolue = 0; $this->remise_absolue = 0;
$langs->load("supplier_proposal"); $langs->load("supplier_proposal");
$this->labelstatut[0]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFT_LABEL : $langs->trans("AskpricesupplierStatusDraft")); $this->labelstatut[0]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFT_LABEL : $langs->trans("SupplierProposalStatusDraft"));
$this->labelstatut[1]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATED_LABEL : $langs->trans("AskpricesupplierStatusValidated")); $this->labelstatut[1]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATED_LABEL : $langs->trans("SupplierProposalStatusValidated"));
$this->labelstatut[2]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNED_LABEL : $langs->trans("AskpricesupplierStatusSigned")); $this->labelstatut[2]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNED_LABEL : $langs->trans("SupplierProposalStatusSigned"));
$this->labelstatut[3]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNED_LABEL : $langs->trans("AskpricesupplierStatusNotSigned")); $this->labelstatut[3]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNED_LABEL : $langs->trans("SupplierProposalStatusNotSigned"));
$this->labelstatut[4]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_BILLED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_BILLED_LABEL : $langs->trans("AskpricesupplierStatusBilled")); $this->labelstatut[4]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_BILLED_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_BILLED_LABEL : $langs->trans("SupplierProposalStatusBilled"));
$this->labelstatut_short[0]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFTSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFTSHORT_LABEL : $langs->trans("AskpricesupplierStatusDraftShort")); $this->labelstatut_short[0]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFTSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_DRAFTSHORT_LABEL : $langs->trans("SupplierProposalStatusDraftShort"));
$this->labelstatut_short[1]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATEDSHORT_LABEL : $langs->trans("Opened")); $this->labelstatut_short[1]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_VALIDATEDSHORT_LABEL : $langs->trans("Opened"));
$this->labelstatut_short[2]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNEDSHORT_LABEL : $langs->trans("AskpricesupplierStatusSignedShort")); $this->labelstatut_short[2]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_SIGNEDSHORT_LABEL : $langs->trans("SupplierProposalStatusSignedShort"));
$this->labelstatut_short[3]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNEDSHORT_LABEL : $langs->trans("AskpricesupplierStatusNotSignedShort")); $this->labelstatut_short[3]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_NOTSIGNEDSHORT_LABEL : $langs->trans("SupplierProposalStatusNotSignedShort"));
$this->labelstatut_short[4]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_BILLEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_BILLEDSHORT_LABEL : $langs->trans("AskpricesupplierStatusBilledShort")); $this->labelstatut_short[4]=(! empty($conf->global->SUPPLIER_PROPOSAL_STATUS_BILLEDSHORT_LABEL) ? $conf->global->SUPPLIER_PROPOSAL_STATUS_BILLEDSHORT_LABEL : $langs->trans("SupplierProposalStatusBilledShort"));
} }
@ -627,7 +627,7 @@ class SupplierProposal extends CommonObject
} }
else else
{ {
dol_syslog(get_class($this)."::updateline Erreur -2 Askpricesupplier en mode incompatible pour cette action"); dol_syslog(get_class($this)."::updateline Erreur -2 SupplierProposal en mode incompatible pour cette action");
return -2; return -2;
} }
} }
@ -2259,7 +2259,7 @@ class SupplierProposal extends CommonObject
global $langs; global $langs;
$result=''; $result='';
$label=$langs->trans("ShowAskpricesupplier").': '.$this->ref; $label=$langs->trans("ShowSupplierProposal").': '.$this->ref;
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') { if ($option == '') {
$link = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$this->id. $get_params .$linkclose; $link = '<a href="'.DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$this->id. $get_params .$linkclose;

View File

@ -133,7 +133,7 @@ if ($resql)
{ {
print '<tr '.$bc[false].'><td align="center" colspan="2">'; print '<tr '.$bc[false].'><td align="center" colspan="2">';
$data=array('series'=>$dataseries); $data=array('series'=>$dataseries);
dol_print_graph('stats',300,180,$data,1,'pie',1); dol_print_graph('stats',300,180,$data,1,'pie',1,'',0);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -25,9 +25,9 @@
*/ */
/** /**
* \file htdocs/comm/propal/list.php * \file htdocs/supplier_proposal/list.php
* \ingroup propal * \ingroup supplier_proposal
* \brief Page of commercial proposals card and list * \brief Page of supplier proposals card and list
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -96,6 +96,16 @@ if (GETPOST("button_removefilter") || GETPOST("button_removefilter_x")) // Both
if($object_statut != '') if($object_statut != '')
$viewstatut=$object_statut; $viewstatut=$object_statut;
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'p.ref'=>'Ref',
's.nom'=>'Supplier',
'pd.description'=>'Description',
'p.note_private'=>"NotePrivate",
'p.note_public'=>'NotePublic',
);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('supplier_proposallist')); $hookmanager->initHooks(array('supplier_proposallist'));
@ -175,7 +185,7 @@ if ($search_montant_ht)
$sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'"; $sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'";
} }
if ($sall) { if ($sall) {
$sql .= natural_search(array('s.nom', 'p.note_private', 'p.note_public', 'pd.description'), $sall); $sql .= natural_search(array_keys($fieldstosearchall), $sall);
} }
if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($socid) $sql.= ' AND s.rowid = '.$socid;
if ($viewstatut <> '') if ($viewstatut <> '')
@ -240,7 +250,19 @@ if ($result)
// Lignes des champs de filtre // Lignes des champs de filtre
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
//sort($fieldstosearchall);
print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
}
$i = 0; $i = 0;
$moreforfilter=''; $moreforfilter='';
@ -276,7 +298,7 @@ if ($result)
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">';
print '<tr class="liste_titre">'; 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('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('Supplier'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('SupplierProposalDate'),$_SERVER["PHP_SELF"],'p.date_livraison','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('SupplierProposalDate'),$_SERVER["PHP_SELF"],'p.date_livraison','',$param, 'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('AmountHT'),$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Author'),$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);