Fix: morning strict mode

This commit is contained in:
Regis Houssin 2012-10-31 09:50:20 +01:00
parent 64d8d558a5
commit 0e0bbbeddc
4 changed files with 21 additions and 24 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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); $product_static=new Product($db);
$expedition=new Expedition($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.= ", 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,"; $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,"; //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 '<td align="center">'.$objp->qty_shipped.'</td>'; print '<td align="center">'.$objp->qty_shipped.'</td>';
// Informations on receipt // Informations on receipt
if ($conf->livraison_bon->enabled) if (! empty($conf->livraison_bon->enabled))
{ {
include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php';
$expedition->id=$objp->sendingid; $expedition->id=$objp->sendingid;
$expedition->fetchObjectLinked($expedition->id,$expedition->element); $expedition->fetchObjectLinked($expedition->id,$expedition->element);
//var_dump($expedition->linkedObjects); //var_dump($expedition->linkedObjects);
$receiving=$expedition->linkedObjects['delivery'][0]; $receiving=(! empty($expedition->linkedObjects['delivery'][0])?$expedition->linkedObjects['delivery'][0]:'');
if (! empty($receiving)) if (! empty($receiving))
{ {

View File

@ -1,9 +1,9 @@
<?php <?php
/* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2008 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be> * Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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; 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; $this->pdf_filename = $file;
// Tracking url // Tracking url

View File

@ -46,6 +46,7 @@ $object = new Expedition($db);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$object->fetch($id, $ref); $object->fetch($id, $ref);
$object->fetch_thirdparty();
if (!empty($object->origin)) if (!empty($object->origin))
{ {
@ -151,14 +152,9 @@ if ($id > 0 || ! empty($ref))
{ {
$langs->trans("OrderCard"); $langs->trans("OrderCard");
$soc = new Societe($db);
$soc->fetch($object->socid);
$head = shipping_prepare_head($object); $head = shipping_prepare_head($object);
dol_fiche_head($head, 'contact', $langs->trans("Sending"), 0, 'sending'); dol_fiche_head($head, 'contact', $langs->trans("Sending"), 0, 'sending');
if (is_null($object->client)) $object->fetch_thirdparty();
/* /*
* Facture synthese pour rappel * Facture synthese pour rappel
@ -174,7 +170,7 @@ if ($id > 0 || ! empty($ref))
// Customer // Customer
print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
print '<td colspan="3">'.$soc->getNomUrl(1).'</td>'; print '<td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td>';
print "</tr>"; print "</tr>";
// Linked documents // Linked documents
@ -211,7 +207,7 @@ if ($id > 0 || ! empty($ref))
print $objectsrc->ref_client; print $objectsrc->ref_client;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Delivery address // Delivery address
if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{ {
@ -219,11 +215,11 @@ if ($id > 0 || ! empty($ref))
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('DeliveryAddress'); print $langs->trans('DeliveryAddress');
print '</td>'; print '</td>';
if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>'; if ($action != 'editdelivery_address' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editdelivery_address&amp;socid='.$object->socid.'&amp;id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDeliveryAddress'),1).'</a></td>';
print '</tr></table>'; print '</tr></table>';
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($action == 'editdelivery_address') if ($action == 'editdelivery_address')
{ {
$formother->form_address($_SERVER['PHP_SELF'].'?id='.$object->id,$object->fk_delivery_address,$object->socid,'fk_address','shipping',$object->id); $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 '</td>'; print '</td>';
print '<td colspan="1">'; print '<td colspan="1">';
//$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');
$form->select_users($user->id,'contactid',0,$userAlreadySelected);
print '</td>'; print '</td>';
print '<td>'; print '<td>';
$formcompany->selectTypeContact($objectsrc, '', 'type','internal'); $formcompany->selectTypeContact($objectsrc, '', 'type','internal');

View File

@ -54,8 +54,9 @@ $id = $origin_id;
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
// Security check // Security check
$socid='';
if ($user->societe_id) $socid=$user->societe_id; 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 // 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'; include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
@ -1058,7 +1059,7 @@ else
// Volume Total // Volume Total
print '<tr><td>'.$langs->trans("Volume").'</td>'; print '<tr><td>'.$langs->trans("Volume").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
if ($object->trueVolume) if (! empty($object->trueVolume)) // FIXME trueVolume not exist
{ {
// If sending volume defined // If sending volume defined
print $object->trueVolume.' '.measuring_units_string($object->volumeUnit,"volume"); print $object->trueVolume.' '.measuring_units_string($object->volumeUnit,"volume");
@ -1153,7 +1154,7 @@ else
} }
print '<td>'.$langs->trans("Products").'</td>'; print '<td>'.$langs->trans("Products").'</td>';
print '<td align="center">'.$langs->trans("QtyOrdered").'</td>'; print '<td align="center">'.$langs->trans("QtyOrdered").'</td>';
if ($object->fk_statut <= 1) if ($object->statut <= 1)
{ {
print '<td align="center">'.$langs->trans("QtyToShip").'</td>'; print '<td align="center">'.$langs->trans("QtyToShip").'</td>';
} }