From 0f23cef46c6235be07944eb9d3cc05d25c1c97d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jul 2016 18:59:36 +0200 Subject: [PATCH] Fix warning of the repair tool. --- .../class/fournisseur.commande.class.php | 2 +- htdocs/install/repair.php | 41 +++++++++++++------ 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3c36bc611fd..19395db756c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -313,7 +313,7 @@ class CommandeFournisseur extends CommonOrder $line->date_end = $this->db->jdate($objp->date_end); $line->fk_unit = $objp->fk_unit; - $this->special_line = $objp->special_line; + $this->special_code = $objp->special_code; $this->fk_parent_line = $objp->fk_parent_line; $this->rang = $objp->rang; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index d6a26534586..d4679c9ac0c 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -73,6 +73,11 @@ $actiondone=1; print '

'.$langs->trans("Repair").'

'; +print 'Option restore_thirdparties_logos is '.(GETPOST('restore_thirdparties_logos')?GETPOST('restore_thirdparties_logos'):'0').'
'."\n"; +print 'Option clean_linked_elements is '.(GETPOST('clean_linked_elements')?GETPOST('clean_linked_elements'):'0').'
'."\n"; +print 'Option clean_orphelin_dir (1 or confirmed) is '.(GETPOST('clean_orphelin_dir')?GETPOST('clean_orphelin_dir'):'0').'
'."\n"; +print '
'; + print ''; $error=0; @@ -196,7 +201,8 @@ if ($ok) } -// sync_extrafields: Search list of fields declared and list of fields created into databases and create fields missing +// sync_extrafields: Search list of fields declared and list of fields created into databases, then create fields missing + if ($ok) { $extrafields=new ExtraFields($db); @@ -204,6 +210,7 @@ if ($ok) 'socpeople'=>'socpeople', 'commande'=>'commande', 'facture'=>'facture', 'commande_fournisseur'=>'commande_fournisseur', 'actioncomm'=>'actioncomm', 'adherent_type'=>'adherent_type','user'=>'user','projet'=>'projet', 'projet_task'=>'projet_task'); + print ''; foreach($listofmodulesextra as $tablename => $elementtype) { // Get list of fields @@ -292,6 +299,8 @@ if ($ok && GETPOST('restore_thirdparties_logos')) //$exts=array('gif','png','jpg'); $ext=''; + + print ''; //} } @@ -360,23 +371,24 @@ if ($ok && GETPOST('restore_thirdparties_logos')) // clean_linked_elements: Check and clean linked elements if ($ok && GETPOST('clean_linked_elements')) { + print ''; // propal => order - print "\n"; + print '\n"; // propal => invoice - print "\n"; + print '\n"; // order => invoice - print "\n"; + print '\n"; // order => shipping - print "\n"; + print '\n"; // shipping => delivery - print "\n"; + print '\n"; // order_supplier => invoice_supplier - print "\n"; + print '\n"; } @@ -399,11 +411,16 @@ if ($ok && GETPOST('clean_orphelin_dir')) if (empty($upload_dir)) continue; - print ''; + print ''; - $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview\.png)$','^temp$','^payments$','^CVS$','^thumbs$'),'',SORT_DESC,1); + $filearray=dol_dir_list($upload_dir,"files",1,'',array('^SPECIMEN\.pdf$','^\.','(\.meta|_preview\.png)$','^temp$','^payments$','^CVS$','^thumbs$'),'',SORT_DESC,1,true); // To show ref or specific information according to view to show (defined by $module) + if ($modulepart == 'company') + { + include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; + $object_instance=new Societe($db); + } if ($modulepart == 'invoice') { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -460,7 +477,7 @@ if ($ok && GETPOST('clean_orphelin_dir')) preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; } if ($modulepart == 'invoice_supplier') { - preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=$reg[1]; + preg_match('/(\d+)\/[^\/]+$/',$relativefile,$reg); $id=empty($reg[1])?'':$reg[1]; } if ($modulepart == 'propal') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=$reg[1]; @@ -488,7 +505,7 @@ if ($ok && GETPOST('clean_orphelin_dir')) // Clean of orphelins directories are done into repair.php print '

Check fields into extra table structure match table of definition. If not add column into table

'; //foreach($exts as $ext) //{ $sql="SELECT s.rowid, s.nom as name, s.logo FROM ".MAIN_DB_PREFIX."societe as s ORDER BY s.nom"; @@ -353,6 +362,8 @@ if ($ok && GETPOST('restore_thirdparties_logos')) $ok=0; dol_print_error($db); } + + print '

Check table of linked elements and delete orphelins links
".checkLinkedElements('propal', 'commande')."
'.checkLinkedElements('propal', 'commande')."
".checkLinkedElements('propal', 'facture')."
'.checkLinkedElements('propal', 'facture')."
".checkLinkedElements('commande', 'facture')."
'.checkLinkedElements('commande', 'facture')."
".checkLinkedElements('commande', 'shipping')."
'.checkLinkedElements('commande', 'shipping')."
".checkLinkedElements('shipping', 'delivery')."
'.checkLinkedElements('shipping', 'delivery')."
".checkLinkedElements('order_supplier', 'invoice_supplier')."
'.checkLinkedElements('order_supplier', 'invoice_supplier')."
Clean orphelins files into files '.$upload_dir.'

Clean orphelins files into files '.$upload_dir.'
'; print 'Delete orphelins file '.$file['fullname'].'
'; - if (GETPOST('purge') == 2) + if (GETPOST('clean_orphelin_dir') == 'confirmed') { dol_delete_file($file['fullname'],1,1,1); dol_delete_dir(dirname($file['fullname']),1); @@ -512,7 +529,7 @@ if (empty($actiondone)) } -print '