From 247c380d18815cbe427a7ad4f114d75e673df308 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 12 Dec 2017 16:11:40 +0100 Subject: [PATCH] Several fixes --- htdocs/comm/propal/list.php | 2 +- htdocs/contrat/class/contrat.class.php | 5 +- htdocs/core/actions_massactions.inc.php | 143 +++++++++--------- htdocs/core/class/commonobject.class.php | 7 +- htdocs/core/class/utils.class.php | 5 +- htdocs/core/lib/order.lib.php | 3 +- .../class/fournisseur.commande.class.php | 2 +- htdocs/includes/odtphp/Segment.php | 9 +- .../template/myobject_document.php | 24 --- htdocs/product/stock/class/entrepot.class.php | 2 +- 10 files changed, 93 insertions(+), 109 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 49fb668a916..a4e30300a5d 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -401,7 +401,7 @@ if ($resql) print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit); - $topicmail="SendProposalRef"; + $topicmail="SendPropalRef"; $modelmail="proposal_send"; $objecttmp=new Propal($db); $trackid='pro'.$object->id; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2e19bce5ebe..48768af5a7a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1210,7 +1210,6 @@ class Contrat extends CommonObject if (isset($this->entity)) $this->entity=trim($this->entity); if (isset($this->statut)) $this->statut=(int) $this->statut; if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc); - if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project); if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature=trim($this->fk_commercial_signature); if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi=trim($this->fk_commercial_suivi); if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service=trim($this->fk_user_mise_en_service); @@ -1235,8 +1234,8 @@ class Contrat extends CommonObject $sql.= " mise_en_service=".(dol_strlen($this->mise_en_service)!=0 ? "'".$this->db->idate($this->mise_en_service)."'" : 'null').","; $sql.= " fin_validite=".(dol_strlen($this->fin_validite)!=0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').","; $sql.= " date_cloture=".(dol_strlen($this->date_cloture)!=0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').","; - $sql.= " fk_soc=".(isset($this->fk_soc)?$this->fk_soc:"null").","; - $sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").","; + $sql.= " fk_soc=".($this->fk_soc > 0 ? $this->fk_soc:"null").","; + $sql.= " fk_projet=".($this->fk_project > 0 ? $this->fk_project:"null").","; $sql.= " fk_commercial_signature=".(isset($this->fk_commercial_signature)?$this->fk_commercial_signature:"null").","; $sql.= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi)?$this->fk_commercial_suivi:"null").","; $sql.= " fk_user_mise_en_service=".(isset($this->fk_user_mise_en_service)?$this->fk_user_mise_en_service:"null").","; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 1ea3d3d2e00..b08993acf8a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -23,7 +23,7 @@ // $massaction must be defined -// $objectclass and $$objectlabel must be defined +// $objectclass and $objectlabel must be defined // $parameters, $object, $action must be defined for the hook. // $permtoread, $permtocreate and $permtodelete may be defined @@ -192,70 +192,70 @@ if (! $error && $massaction == 'confirm_presend') //var_dump($listofobjectref);exit; $attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array()); - $listofqualifiedid=array(); + $listofqualifiedobj=array(); $listofqualifiedref=array(); $thirdpartywithoutemail=array(); - foreach($listofobjectref[$thirdpartyid] as $objectid => $object) + foreach($listofobjectref[$thirdpartyid] as $objectid => $objectobj) { - //var_dump($thirdpartyid.' - '.$objectid.' - '.$object->statut); - if ($objectclass == 'Propal' && $object->statut == Propal::STATUS_DRAFT) + //var_dump($thirdpartyid.' - '.$objectid.' - '.$objectobj->statut); + if ($objectclass == 'Propal' && $objectobj->statut == Propal::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$object->ref).'

'; + $resaction.='
'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'

'; continue; // Payment done or started or canceled } - if ($objectclass == 'Commande' && $object->statut == Commande::STATUS_DRAFT) + if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT) { $langs->load("errors"); $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$object->ref).'

'; + $resaction.='
'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'

'; continue; } - if ($objectclass == 'Facture' && $object->statut != Facture::STATUS_VALIDATED) + if ($objectclass == 'Facture' && $objectobj->statut != Facture::STATUS_VALIDATED) { $langs->load("errors"); $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$object->ref).'

'; + $resaction.='
'.$langs->trans('ErrorOnlyInvoiceValidatedCanBeSentInMassAction',$objectobj->ref).'

'; continue; // Payment done or started or canceled } // Test recipient if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send) { - if ($object->element == 'expensereport') + if ($objectobj->element == 'expensereport') { $fuser = new User($db); - $fuser->fetch($object->fk_user_author); + $fuser->fetch($objectobj->fk_user_author); $sendto = $fuser->email; } else { - $object->fetch_thirdparty(); - $sendto = $object->thirdparty->email; + $objectobj->fetch_thirdparty(); + $sendto = $objectobj->thirdparty->email; } } if (empty($sendto)) { - //print "No recipient for thirdparty ".$object->thirdparty->name; + //print "No recipient for thirdparty ".$objectobj->thirdparty->name; $nbignored++; - if (empty($thirdpartywithoutemail[$object->thirdparty->id])) + if (empty($thirdpartywithoutemail[$objectobj->thirdparty->id])) { - $resaction.='
'.$langs->trans('NoRecipientEmail',$object->thirdparty->name).'

'; + $resaction.='
'.$langs->trans('NoRecipientEmail',$objectobj->thirdparty->name).'

'; } - dol_syslog('No recipient for thirdparty: '.$object->thirdparty->name, LOG_WARNING); - $thirdpartywithoutemail[$object->thirdparty->id]=1; + dol_syslog('No recipient for thirdparty: '.$objectobj->thirdparty->name, LOG_WARNING); + $thirdpartywithoutemail[$objectobj->thirdparty->id]=1; continue; } if ($_POST['addmaindocfile']) { - // TODO Use future field $object->fullpathdoc to know where is stored default file - // TODO If not defined, use $object->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. - $filename=dol_sanitizeFileName($object->ref).'.pdf'; - $filedir=$uploaddir . '/' . dol_sanitizeFileName($object->ref); + // TODO Use future field $objectobj->fullpathdoc to know where is stored default file + // TODO If not defined, use $objectobj->modelpdf (or defaut invoice config) to know what is template to use to regenerate doc. + $filename=dol_sanitizeFileName($objectobj->ref).'.pdf'; + $filedir=$uploaddir . '/' . dol_sanitizeFileName($objectobj->ref); $file = $filedir . '/' . $filename; $mime = dol_mimetype($file); @@ -279,15 +279,15 @@ if (! $error && $massaction == 'confirm_presend') } // Object of thirdparty qualified - $listofqualifiedid[$objectid]=$object; - $listofqualifiedref[$objectid]=$object->ref; + $listofqualifiedobj[$objectid]=$objectobj; + $listofqualifiedref[$objectid]=$objectobj->ref; //var_dump($listofqualifiedref); } // Send email if there is at least one qualified record - if (count($listofqualifiedid) > 0) + if (count($listofqualifiedobj) > 0) { $langs->load("commercial"); @@ -331,12 +331,12 @@ if (! $error && $massaction == 'confirm_presend') if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)); if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)); - // $listofqualifiedid is array with key = object id of qualified objects for the current thirdparty + // $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty $oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0); $looparray=array(); if (! $oneemailperrecipient) { - $looparray = $listofqualifiedid; + $looparray = $listofqualifiedobj; } else { @@ -350,7 +350,7 @@ if (! $error && $massaction == 'confirm_presend') { // Make substitution in email content $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); - $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedid)) : $objecttmp->id); + $substitutionarray['__ID__'] = ($oneemailperrecipient ? join(', ',array_keys($listofqualifiedobj)) : $objecttmp->id); $substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ',$listofqualifiedref) : $objecttmp->ref); $substitutionarray['__EMAIL__'] = $thirdparty->email; $substitutionarray['__CHECK_READ__'] = ''; @@ -384,7 +384,7 @@ if (! $error && $massaction == 'confirm_presend') $error=0; // Insert logs into agenda - foreach($listofqualifiedid as $objid => $object) + foreach($listofqualifiedobj as $objid => $objectobj) { /*if ($objectclass == 'Propale') $actiontypecode='AC_PROP'; if ($objectclass == 'Commande') $actiontypecode='AC_COM'; @@ -404,13 +404,13 @@ if (! $error && $massaction == 'confirm_presend') $actionmsg2=''; // Initialisation donnees - $object->sendtoid = 0; - $object->actionmsg = $actionmsg; // Long text - $object->actionmsg2 = $actionmsg2; // Short text - $object->fk_element = $objid; - $object->elementtype = $object->element; + $objectobj->sendtoid = 0; + $objectobj->actionmsg = $actionmsg; // Long text + $objectobj->actionmsg2 = $actionmsg2; // Short text + $objectobj->fk_element = $objid; + $objectobj->elementtype = $objectobj->element; - $triggername = strtoupper(get_class($object)) .'_SENTBYMAIL'; + $triggername = strtoupper(get_class($objectobj)) .'_SENTBYMAIL'; if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL'; if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL'; if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL'; @@ -425,7 +425,7 @@ if (! $error && $massaction == 'confirm_presend') // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($db); - $result=$interface->run_triggers($trigger_name, $object, $user, $langs, $conf); + $result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf); if ($result < 0) { $error++; $errors=$interface->errors; } // Fin appel triggers @@ -499,15 +499,15 @@ if ($massaction == 'confirm_createbills') $cmd = new Commande($db); if ($cmd->fetch($id_order) <= 0) continue; - $object = new Facture($db); - if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. + $objecttmp = new Facture($db); + if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order. else { - $object->socid = $cmd->socid; - $object->type = Facture::TYPE_STANDARD; - $object->cond_reglement_id = $cmd->cond_reglement_id; - $object->mode_reglement_id = $cmd->mode_reglement_id; - $object->fk_project = $cmd->fk_project; + $objecttmp->socid = $cmd->socid; + $objecttmp->type = Facture::TYPE_STANDARD; + $objecttmp->cond_reglement_id = $cmd->cond_reglement_id; + $objecttmp->mode_reglement_id = $cmd->mode_reglement_id; + $objecttmp->fk_project = $cmd->fk_project; $datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); if (empty($datefacture)) @@ -515,16 +515,16 @@ if ($massaction == 'confirm_createbills') $datefacture = dol_mktime(date("h"), date("M"), 0, date("m"), date("d"), date("Y")); } - $object->date = $datefacture; - $object->origin = 'commande'; - $object->origin_id = $id_order; + $objecttmp->date = $datefacture; + $objecttmp->origin = 'commande'; + $objecttmp->origin_id = $id_order; - $res = $object->create($user); + $res = $objecttmp->create($user); if($res > 0) $nb_bills_created++; } - if ($object->id > 0) + if ($objecttmp->id > 0) { $sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element ("; $sql.= "fk_source"; @@ -533,9 +533,9 @@ if ($massaction == 'confirm_createbills') $sql.= ", targettype"; $sql.= ") VALUES ("; $sql.= $id_order; - $sql.= ", '".$object->origin."'"; - $sql.= ", ".$object->id; - $sql.= ", '".$object->element."'"; + $sql.= ", '".$objecttmp->origin."'"; + $sql.= ", ".$objecttmp->id; + $sql.= ", '".$objecttmp->element."'"; $sql.= ")"; if (! $db->query($sql)) @@ -562,7 +562,7 @@ if ($massaction == 'confirm_createbills') { // Negative line, we create a discount line $discount = new DiscountAbsolute($db); - $discount->fk_soc=$object->socid; + $discount->fk_soc=$objecttmp->socid; $discount->amount_ht=abs($lines[$i]->total_ht); $discount->amount_tva=abs($lines[$i]->total_tva); $discount->amount_ttc=abs($lines[$i]->total_ttc); @@ -572,7 +572,7 @@ if ($massaction == 'confirm_createbills') $discountid=$discount->create($user); if ($discountid > 0) { - $result=$object->insert_discount($discountid); + $result=$objecttmp->insert_discount($discountid); //$result=$discount->link_to_invoice($lineid,$id); } else @@ -601,7 +601,7 @@ if ($massaction == 'confirm_createbills') { $fk_parent_line = 0; } - $result = $object->addline( + $result = $objecttmp->addline( $desc, $lines[$i]->subprice, $lines[$i]->qty, @@ -620,7 +620,7 @@ if ($massaction == 'confirm_createbills') $product_type, $ii, $lines[$i]->special_code, - $object->origin, + $objecttmp->origin, $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, @@ -649,8 +649,8 @@ if ($massaction == 'confirm_createbills') //$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module. - if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $object; - else $TFact[$object->id] = $object; + if(!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) $TFactThird[$cmd->socid] = $objecttmp; + else $TFact[$objecttmp->id] = $objecttmp; } // Build doc with all invoices @@ -660,19 +660,19 @@ if ($massaction == 'confirm_createbills') if (! $error && $validate_invoices) { $massaction = $action = 'builddoc'; - foreach($TAllFact as &$object) + foreach($TAllFact as &$objecttmp) { - $result = $object->validate($user); + $result = $objecttmp->validate($user); if ($result <= 0) { $error++; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); break; } - $id = $object->id; // For builddoc action + $id = $objecttmp->id; // For builddoc action - // Fac builddoc + // Builddoc $donotredirect = 1; $upload_dir = $conf->facture->dir_output; $permissioncreate=$user->rights->facture->creer; @@ -693,7 +693,7 @@ if ($massaction == 'confirm_createbills') $action='create'; $_GET["origin"]=$_POST["origin"]; $_GET["originid"]=$_POST["originid"]; - setEventMessages($object->error, $object->errors, 'errors'); + setEventMessages("Error", null, 'errors'); $error++; } } @@ -750,7 +750,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $outputlangs = $langs; $newlang=''; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id','aZ09')) $newlang=GETPOST('lang_id','aZ09'); - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang; + if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$objecttmp->thirdparty->default_lang; if (! empty($newlang)) { $outputlangs = new Translate("",$conf); @@ -767,7 +767,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $filename=preg_replace('/\s/','_',$filename); // Save merged file - if (in_array($object->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) + if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) { if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); @@ -839,7 +839,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $filename=preg_replace('/\s/','_',$filename); // Save merged file - if (in_array($object->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) + if (in_array($objecttmp->element, array('facture', 'facture_fournisseur')) && $search_status == Facture::STATUS_VALIDATED) { if ($option=='late') $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))).'_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Late"))); else $filename.='_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); @@ -881,13 +881,15 @@ if ($action == 'remove_file') // Validate records if (! $error && $massaction == 'validate' && $permtocreate) { - if ($object->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + $objecttmp=new $objectclass($db); + + if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); $error++; } - if ($object->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) + if ($objecttmp->element == 'invoice_supplier' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors'); @@ -897,7 +899,6 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $db->begin(); - $objecttmp=new $objectclass($db); $nbok = 0; foreach($toselect as $toselectid) { @@ -962,7 +963,7 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm == { $langs->load("errors"); $nbignored++; - $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$object->ref).'

'; + $resaction.='
'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction',$objecttmp->ref).'

'; continue; }*/ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5c7c692a1dc..37f87ca1da2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4167,7 +4167,12 @@ abstract class CommonObject // Set the public "share" key $setsharekey = false; - if ($this->element == 'propal' && ! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; + if ($this->element == 'propal') + { + $useonlinesignature = $conf->global->MAIN_FEATURES_LEVEL; // Replace this with 1 when feature to make online signature is ok + if ($useonlinesignature) $setsharekey=true; + if (! empty($conf->global->PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; + } if ($this->element == 'commande' && ! empty($conf->global->ORDER_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; if ($this->element == 'facture' && ! empty($conf->global->INVOICE_ALLOW_EXTERNAL_DOWNLOAD)) $setsharekey=true; if ($setsharekey) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index cce4a063ca6..4502eb03240 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -531,7 +531,8 @@ class Utils */ function generateDoc($module) { - global $conf, $dirins; + global $conf, $langs; + global $dirins; $error = 0; @@ -549,7 +550,7 @@ class Utils if (class_exists($class)) { try { - $moduleobj = new $class($db); + $moduleobj = new $class($this->db); } catch(Exception $e) { diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 430808da074..cdbd46b1aa7 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -63,7 +63,8 @@ function commande_prepare_head(Commande $object) { $nbShipments=$object->getNbOfShipments(); $nbReceiption=0; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; - if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipments"); + $text=''; + if ($conf->expedition_bon->enabled) $text.=$langs->trans("Shipments"); if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text.='/'; if ($conf->livraison_bon->enabled) $text.=$langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text.= ' '.($nbShipments?$nbShipments:0); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 51718f500a5..868014ea618 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2350,7 +2350,7 @@ class CommandeFournisseur extends CommonOrder * @param string $ref_supplier Supplier ref * @return int < 0 if error, > 0 if ok */ - public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=false, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise=0, $ref_supplier='') + public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $notrigger=0, $date_start='', $date_end='', $array_options=0, $fk_unit=null, $pu_ht_devise=0, $ref_supplier='') { global $mysoc, $conf; dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit"); diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php index f9a44b996b2..8cea06db50b 100644 --- a/htdocs/includes/odtphp/Segment.php +++ b/htdocs/includes/odtphp/Segment.php @@ -173,19 +173,20 @@ class Segment implements IteratorAggregate, Countable */ public function macroReplace($text) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; global $langs; $hoy = dol_getdate(dol_now('tzuser')); $dateinonemontharray = dol_get_next_month($hoy['mon'], $hoy['year']); $nextMonth = $dateinonemontharray['month']; - + $patterns=array( '/__CURRENTDAY__/u','/__CURENTWEEKDAY__/u', '/__CURRENTMONTH__/u','/__CURRENTMONTHLONG__/u', '/__NEXTMONTH__/u','/__NEXTMONTHLONG__/u', '/__CURRENTYEAR__/u','/__NEXTYEAR__/u' ); - $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']), - $hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']), - $nextMonth, monthArray($langs)[$nextMonth], + $values=array( $hoy['mday'], $langs->transnoentitiesnoconv($hoy['weekday']), + $hoy['mon'], $langs->transnoentitiesnoconv($hoy['month']), + $nextMonth, monthArray($langs)[$nextMonth], $hoy['year'], $hoy['year']+1 ); $text=preg_replace($patterns, $values, $text); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 05b76b3d588..3462cde52d2 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -133,30 +133,6 @@ if ($object->id) print '
'; print ''; - // Prefix - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - - if ($object->client) - { - print ''; - } - - if ($object->fournisseur) - { - print ''; - } - // Number of files print ''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 6ff271e062f..a656eaa68b9 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -442,7 +442,7 @@ class Entrepot extends CommonObject } /** - * Return number of unique different product into a warehosue + * Return number of unique different product into a warehouse * * @return Array Array('nb'=>Nb, 'value'=>Value) */
'.$langs->trans('Prefix').''.$object->prefix_comm.'
'; - print $langs->trans('CustomerCode').''; - print $object->code_client; - if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')'; - print '
'; - print $langs->trans('SupplierCode').''; - print $object->code_fournisseur; - if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'