From 0e0bbbeddc5d711c3ed6b8f4a3917981220283e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 31 Oct 2012 09:50:20 +0100 Subject: [PATCH] Fix: morning strict mode --- htdocs/core/lib/sendings.lib.php | 9 +++++---- htdocs/expedition/class/expedition.class.php | 12 ++++++------ htdocs/expedition/contact.php | 17 ++++++----------- htdocs/expedition/fiche.php | 7 ++++--- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index b47daaf4166..d031bdd167c 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2008-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,7 +128,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='') $product_static=new Product($db); $expedition=new Expedition($db); - $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked"; + $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql.= ", ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line"; $sql.= ", e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,"; //if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; @@ -263,13 +264,13 @@ function show_list_sending_receive($origin,$origin_id,$filter='') print ''.$objp->qty_shipped.''; // Informations on receipt - if ($conf->livraison_bon->enabled) + if (! empty($conf->livraison_bon->enabled)) { include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; $expedition->id=$objp->sendingid; $expedition->fetchObjectLinked($expedition->id,$expedition->element); //var_dump($expedition->linkedObjects); - $receiving=$expedition->linkedObjects['delivery'][0]; + $receiving=(! empty($expedition->linkedObjects['delivery'][0])?$expedition->linkedObjects['delivery'][0]:''); if (! empty($receiving)) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index c9d0cb124fc..0b2bee2a022 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1,9 +1,9 @@ - * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2007 Franky Van Liedekerke - * Copyright (C) 2006-2008 Laurent Destailleur - * Copyright (C) 2011-2012 Juanjo Menent +/* Copyright (C) 2003-2008 Rodolphe Quiedeville + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2007 Franky Van Liedekerke + * Copyright (C) 2006-2012 Laurent Destailleur + * Copyright (C) 2011-2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -395,7 +395,7 @@ class Expedition extends CommonObject if ($this->statut == 0) $this->brouillon = 1; - $file = $conf->expedition->dir_output . "/" .get_exdir($expedition->id,2) . "/" . $this->id.".pdf"; + $file = $conf->expedition->dir_output . "/" .get_exdir($this->id, 2) . "/" . $this->id.".pdf"; $this->pdf_filename = $file; // Tracking url diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 7f09e1e3c12..35eb703a12a 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -46,6 +46,7 @@ $object = new Expedition($db); if ($id > 0 || ! empty($ref)) { $object->fetch($id, $ref); + $object->fetch_thirdparty(); if (!empty($object->origin)) { @@ -151,14 +152,9 @@ if ($id > 0 || ! empty($ref)) { $langs->trans("OrderCard"); - $soc = new Societe($db); - $soc->fetch($object->socid); - - $head = shipping_prepare_head($object); dol_fiche_head($head, 'contact', $langs->trans("Sending"), 0, 'sending'); - if (is_null($object->client)) $object->fetch_thirdparty(); /* * Facture synthese pour rappel @@ -174,7 +170,7 @@ if ($id > 0 || ! empty($ref)) // Customer print ''.$langs->trans("Customer").''; - print ''.$soc->getNomUrl(1).''; + print ''.$object->thirdparty->getNomUrl(1).''; print ""; // Linked documents @@ -211,7 +207,7 @@ if ($id > 0 || ! empty($ref)) print $objectsrc->ref_client; print ''; print ''; - + // Delivery address if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) { @@ -219,11 +215,11 @@ if ($id > 0 || ! empty($ref)) print ''; - + if ($action != 'editdelivery_address' && $object->brouillon) print ''; print '
'; print $langs->trans('DeliveryAddress'); print 'socid.'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'
'; print ''; - + if ($action == 'editdelivery_address') { $formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipping',$object->id); @@ -276,8 +272,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; - //$userAlreadySelected = $object->getListContactId('internal'); // On ne doit pas desactiver un contact deja selectionne car on doit pouvoir le selectionner une deuxieme fois pour un autre type - $form->select_users($user->id,'contactid',0,$userAlreadySelected); + $form->select_users($user->id,'contactid'); print ''; print ''; $formcompany->selectTypeContact($objectsrc, '', 'type','internal'); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 7ee312a200a..ed6c44ef8a0 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -54,8 +54,9 @@ $id = $origin_id; $ref=GETPOST('ref','alpha'); // Security check +$socid=''; if ($user->societe_id) $socid=$user->societe_id; -$result=restrictedArea($user,$origin,$origin_id); +$result=restrictedArea($user, $origin, $origin_id); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; @@ -1058,7 +1059,7 @@ else // Volume Total print ''.$langs->trans("Volume").''; print ''; - if ($object->trueVolume) + if (! empty($object->trueVolume)) // FIXME trueVolume not exist { // If sending volume defined print $object->trueVolume.' '.measuring_units_string($object->volumeUnit,"volume"); @@ -1153,7 +1154,7 @@ else } print ''.$langs->trans("Products").''; print ''.$langs->trans("QtyOrdered").''; - if ($object->fk_statut <= 1) + if ($object->statut <= 1) { print ''.$langs->trans("QtyToShip").''; }