From 0c113d33a61e43f2275b7be72b48e1fb12aea1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 29 Dec 2012 13:12:45 +0100 Subject: [PATCH] Removed unuseful code Some lines may be marked as changed but they are not because of incorrect line endings --- htdocs/compta/facture.php | 2 +- htdocs/contrat/contact.php | 2 +- htdocs/contrat/fiche.php | 88 +++++++++++++++---------------- htdocs/fourn/commande/contact.php | 2 +- htdocs/fourn/commande/fiche.php | 2 - htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/fiche.php | 8 +-- 7 files changed, 52 insertions(+), 54 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b6a73ceaa60..58039547586 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1649,7 +1649,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->facture- if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0) diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index c01106b7ccf..a75192c81b2 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -57,7 +57,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 935f0cf69c4..50625df45f7 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -208,8 +208,8 @@ else if ($action == 'addline' && $user->rights->contrat->creer) } if ((GETPOST('price_ht') == '' || ! GETPOST('dp_desc')) && ! GETPOST('idprod')) { - setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")),'errors'); - $error++; + setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")),'errors'); + $error++; } if (! $error) @@ -355,13 +355,13 @@ else if ($action == 'addline' && $user->rights->contrat->creer) } */ - unset($_POST['qty']); - unset($_POST['type']); - unset($_POST['idprod']); - unset($_POST['remise_percent']); - unset($_POST['price_ht']); - unset($_POST['tva_tx']); - unset($_POST['dp_desc']); + unset($_POST['qty']); + unset($_POST['type']); + unset($_POST['idprod']); + unset($_POST['remise_percent']); + unset($_POST['price_ht']); + unset($_POST['tva_tx']); + unset($_POST['dp_desc']); } else { @@ -514,7 +514,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->contrat- if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); + $result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source')); } if ($result >= 0) @@ -1017,13 +1017,13 @@ else print $objp->label?$objp->label.'
':''; } - // editeur wysiwyg - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $nbrows=ROWS_2; - if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; - $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); - $doleditor=new DolEditor('product_desc',$objp->description,'',92,'dolibarr_details','',false,true,$enable,$nbrows,70); - $doleditor->Create(); + // editeur wysiwyg + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $nbrows=ROWS_2; + if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT; + $enable=(isset($conf->global->FCKEDITOR_ENABLE_DETAILS)?$conf->global->FCKEDITOR_ENABLE_DETAILS:0); + $doleditor=new DolEditor('product_desc',$objp->description,'',92,'dolibarr_details','',false,true,$enable,$nbrows,70); + $doleditor->Create(); print ''; print ''; @@ -1292,32 +1292,32 @@ else $savproductenabled=$conf->product->enabled; $conf->product->enabled = 0; - // Form to add new line - if ($action != 'editline') - { - $var=true; - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) - { - // Add free or predefined products/services - $object->formAddObjectLine($dateSelector,$mysoc,$object->thirdparty,$hookmanager); - } - else - { - // Add free products/services - $object->formAddFreeProduct($dateSelector,$mysoc,$object->thirdparty,$hookmanager); - - // Add predefined products/services - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $var=!$var; - $object->formAddPredefinedProduct($dateSelector,$mysoc,$object->thirdparty,$hookmanager); - } - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - } + // Form to add new line + if ($action != 'editline') + { + $var=true; + + if ($conf->global->MAIN_FEATURES_LEVEL > 1) + { + // Add free or predefined products/services + $object->formAddObjectLine($dateSelector,$mysoc,$object->thirdparty,$hookmanager); + } + else + { + // Add free products/services + $object->formAddFreeProduct($dateSelector,$mysoc,$object->thirdparty,$hookmanager); + + // Add predefined products/services + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) + { + $var=!$var; + $object->formAddPredefinedProduct($dateSelector,$mysoc,$object->thirdparty,$hookmanager); + } + } + + $parameters=array(); + $reshook=$hookmanager->executeHooks('formAddObjectLine',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + } // Restore correct setup $conf->product->enabled = $savproductenabled; @@ -1373,7 +1373,7 @@ else } else { - print ''.$langs->trans("Delete").''; + print ''.$langs->trans("Delete").''; } print ""; diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 7d4ca868b5d..b8ae9a30bbb 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -56,7 +56,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0) diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index e7e4c1d6161..51cf3cfb541 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1677,8 +1677,6 @@ if (! empty($object->id)) print $formfile->showdocuments('commande_fournisseur',$comfournref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,0,0,'','','',$object->thirdparty->default_lang); $somethingshown=$formfile->numoffiles; - $object=$object; - /* * Linked object block */ diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index 87c55fe2850..81a36704a4d 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -56,7 +56,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 8a4b4b2fe96..dbef10b7d93 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -281,9 +281,9 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) if ($element == 'order_supplier') { $element = 'fourn'; $subelement = 'fournisseur.commande'; } - if ($element == 'project') - { - $element = 'projet'; + if ($element == 'project') + { + $element = 'projet'; } $object->origin = $_POST['origin']; $object->origin_id = $_POST['originid']; @@ -867,7 +867,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->fourniss if ($result > 0 && $id > 0) { $contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid')); - $result = $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); + $result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]); } if ($result >= 0)