From a3c29f2e9ca89be6a3b8dc01e549e376995a1dd9 Mon Sep 17 00:00:00 2001 From: phf Date: Mon, 2 Feb 2015 15:41:14 +0100 Subject: [PATCH] =?UTF-8?q?[CORE]=20Avancement=20du=20fonctionnement=20du?= =?UTF-8?q?=20module,=20correction=20bug=20et=20=C3=A9puration=20de=20l'af?= =?UTF-8?q?fichage=20(#new=5Fask=5Fprice).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/askpricesupplier.php | 73 ++++++++++----- .../class/askpricesupplier.class.php | 92 +++++++++++++++---- .../mod_askpricesupplier_marbre.php | 6 +- .../mod_askpricesupplier_saphir.php | 6 +- .../modules/modAskPriceSupplier.class.php | 14 --- htdocs/langs/fr_FR/askpricesupplier.lang | 4 +- 6 files changed, 135 insertions(+), 60 deletions(-) diff --git a/htdocs/comm/askpricesupplier.php b/htdocs/comm/askpricesupplier.php index 46533a84210..cf296ef9417 100644 --- a/htdocs/comm/askpricesupplier.php +++ b/htdocs/comm/askpricesupplier.php @@ -249,18 +249,12 @@ if (empty($reshook)) $datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_delivery = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); - $duration = GETPOST('duree_validite'); if (empty($datep)) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); $action = 'create'; $error ++; } - if (empty($duration)) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); - $action = 'create'; - $error ++; - } if ($socid < 1) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); @@ -969,7 +963,7 @@ if (empty($reshook)) } } - else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) { + else if ($action == 'updateligne' && $user->rights->askpricesupplier->creer && GETPOST('cancel') == $langs->trans('Cancel')) { header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); // Pour reaffichage de la fiche en cours d'edition exit(); } @@ -1664,6 +1658,7 @@ if ($action == 'create') print ''; // Ref customer + /* PHFAVRE retrait en temporaire print ''; print ''; @@ -1684,12 +1679,14 @@ if ($action == 'create') } print ''; print ''; - + */ + // Company - print ''; + print ''; print ''; // Ligne info remises tiers + /* PHFAVRE retrait en temporaire print ''; - + */ + // Date of proposal print ''; print ''; // Date end proposal + /* PHFAVRE retrait en temporaire print ''; print '
'; print $langs->trans('RefCustomer') . '
' . $langs->trans('Company') . '' . $soc->getNomUrl(1) . '
' . $langs->trans('Supplier') . '' . $soc->getNomUrl(1) . '
' . $langs->trans('Discounts') . ''; if ($soc->remise_percent) print $langs->trans("CompanyHasRelativeDiscount", $soc->remise_percent); @@ -1716,7 +1713,8 @@ if ($action == 'create') if (! $absolute_discount && ! $absolute_creditnote) print $langs->trans("CompanyHasNoAbsoluteDiscount") . '.'; print '
'; @@ -1744,6 +1742,7 @@ if ($action == 'create') print '
'; print ''; print ''; - + */ + // Payment term print '
'; @@ -1771,7 +1770,8 @@ if ($action == 'create') } print '
'; print ''; // Delivery date + /* PHFAVRE retrait en temporaire $langs->load('deliveries'); print '
'; @@ -1790,6 +1790,7 @@ if ($action == 'create') print '
'; print ''; print ''; - + */ + // Delivery delay + /* PHFAVRE retrait en temporaire print '
'; @@ -1811,8 +1812,10 @@ if ($action == 'create') } print '
'; print ''; print ''; - + */ + // Shipping Method + /* PHFAVRE retrait en temporaire if (! empty($conf->expedition->enabled)) { print ''; $form_close .= '
'; print $langs->trans('AvailabilityPeriod'); @@ -1831,8 +1834,10 @@ if ($action == 'create') print '
'; print ''; print ''; } - + */ + // Origin of demand + /* PHFAVRE retrait en temporaire print '
'; @@ -1850,8 +1855,10 @@ if ($action == 'create') print '
'; print ''; print ''; - + */ + // Payment mode print ''; print ''; // Project + /* if (! empty($conf->projet->enabled)) { $langs->load("projects"); print ''; } - + */ + if ($soc->outstanding_limit) { // Outstanding Bill @@ -1938,7 +1948,7 @@ if ($action == 'create') print '
'; print $langs->trans('Source'); @@ -1867,7 +1874,8 @@ if ($action == 'create') } print '
'; @@ -1886,6 +1894,7 @@ if ($action == 'create') print '
'; @@ -1918,7 +1927,8 @@ if ($action == 'create') } print '
'; - if ($action != 'editbankaccount' && $user->rights->propal->creer) + if ($action != 'editbankaccount' && $user->rights->askpricesupplier->creer) print ''; print '
'; print $langs->trans('BankAccount'); print 'id.'">'.img_edit($langs->trans('SetBankAccount'),1).'
'; print '
'; @@ -2033,6 +2043,7 @@ if ($action == 'create') $ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1); // Form to add new line + /* PHFAVRE retrait en temporaire*/ if ($object->statut == 0 && $user->rights->askpricesupplier->creer) { if ($action != 'editline') @@ -2046,7 +2057,25 @@ if ($action == 'create') $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook } } + + + /* + // Form to add new line + if ($object->statut == 0 && $user->rights->askpricesupplier->creer) + { + // Add free products/services form + global $forceall, $senderissupplier, $dateSelector; + $forceall=1; $senderissupplier=1; $dateSelector=0; + $var = true; + + // Add free products/services + $object->formAddObjectLine(1, $mysoc, $object); + + $parameters = array(); + $reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + } +*/ print '
'; print "\n"; @@ -2065,8 +2094,8 @@ if ($action == 'create') $form_close .= ''; $form_close .= ''; $form_close .= '
' . $langs->trans('Note') . '