From 6adaf2fa8fde1788ff9392605e795b5732234364 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:02:10 +0200 Subject: [PATCH 01/16] Fix: Pb when using virtual products inside virtual products --- htdocs/product/class/product.class.php | 153 +++++++++++-------------- 1 file changed, 65 insertions(+), 88 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 49f1d495cde..22c6aa0e6c1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1799,8 +1799,16 @@ class Product extends CommonObject */ function add_sousproduit($id_pere, $id_fils,$qty) { - $sql = 'DELETE from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_pere.'" AND fk_product_fils = "'.$id_fils.'"'; + // Clean parameters + if (! is_numeric($id_pere)) $id_pere=0; + if (! is_numeric($id_fils)) $id_fils=0; + + $result=$this->del_sousproduit($id_pere, $id_fils); + if ($result < 0) return $result; + + // Check not already father of id_pere (to avoid father -> child -> father links) + $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; + $sql .= ' WHERE fk_product_pere = '.$id_fils.' AND fk_product_fils = '.$id_pere; if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -1808,37 +1816,27 @@ class Product extends CommonObject } else { - $sql = 'SELECT fk_product_pere from '.MAIN_DB_PREFIX.'product_association'; - $sql .= ' WHERE fk_product_pere = "'.$id_fils.'" AND fk_product_fils = "'.$id_pere.'"'; - if (! $this->db->query($sql)) + $result = $this->db->query($sql); + if ($result) { - dol_print_error($this->db); - return -1; - } - else - { - $result = $this->db->query($sql); - if ($result) + $num = $this->db->num_rows($result); + if($num > 0) { - $num = $this->db->num_rows($result); - if($num > 0) + $this->error="isFatherOfThis"; + return -1; + } + else + { + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; + $sql .= ' VALUES ('.$id_pere.', '.$id_fils.', '.$qty.')'; + if (! $this->db->query($sql)) { - $this->error="isFatherOfThis"; + dol_print_error($this->db); return -1; } else { - $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_association(fk_product_pere,fk_product_fils,qty)'; - $sql .= ' VALUES ("'.$id_pere.'","'.$id_fils.'","'.$qty.'")'; - if (! $this->db->query($sql)) - { - dol_print_error($this->db); - return -1; - } - else - { - return 1; - } + return 1; } } } @@ -1850,14 +1848,18 @@ class Product extends CommonObject * * @param int $fk_parent Id du produit auquel ne sera plus lie le produit lie * @param int $fk_child Id du produit a ne plus lie - * @return int < 0 si erreur, > 0 si ok + * @return int < 0 if KO, > 0 if OK */ function del_sousproduit($fk_parent, $fk_child) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; - $sql.= " WHERE fk_product_pere = '".$fk_parent."'"; - $sql.= " AND fk_product_fils = '".$fk_child."'"; + if (! is_numeric($fk_parent)) $fk_parent=0; + if (! is_numeric($fk_child)) $fk_child=0; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_association"; + $sql.= " WHERE fk_product_pere = ".$fk_parent; + $sql.= " AND fk_product_fils = ".$fk_child; + + dol_syslog(get_class($this).'::del_sousproduit sql='.$sql); if (! $this->db->query($sql)) { dol_print_error($this->db); @@ -2122,7 +2124,7 @@ class Product extends CommonObject * Define value of this->res * * @param array $prod Products array - * @param string $compl_path Directory path + * @param string $compl_path Directory path of parents to add before * @param int $multiply Because each sublevel must be multiplicated by parent nb * @param int $level Init level * @return void @@ -2132,65 +2134,36 @@ class Product extends CommonObject global $conf,$langs; $product = new Product($this->db); - foreach($prod as $nom_pere => $desc_pere) + //var_dump($prod); + foreach($prod as $id_product => $desc_pere) // nom_pere is 0 or id of sub_product { if (is_array($desc_pere)) // If this parent desc is an array, this is an array of childs { $id=(! empty($desc_pere[0]) ? $desc_pere[0] :''); $nb=(! empty($desc_pere[1]) ? $desc_pere[1] :''); $type=(! empty($desc_pere[2]) ? $desc_pere[2] :''); + $label=(! empty($desc_pere[3]) ? $desc_pere[3] :''); + if ($multiply < 1) $multiply=1; - if ($multiply) - { - //print "XXX ".$desc_pere[1]." multiply=".$multiply; - $img=""; - $this->fetch($id); - $this->load_stock(); - if ($this->stock_warehouse[1]->real < $this->seuil_stock_alerte) - { - $img=img_warning($langs->trans("StockTooLow")); - } - $this->res[]= array( -/* "      -> - ".$compl_path.stripslashes($nom_pere)." - (".$desc_pere[1].") ".($desc_pere[1]*$multiply)."   - ".$this->stock_entrepot[1]." ".$img."", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product - 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock - 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - else - { - $this->fetch($desc_pere[0]); - $this->load_stock(); - $this->res[]= array( -/* $compl_path.$nom_pere." (".$desc_pere[1].")", - $desc_pere[0], // Id product -*/ 'id'=>$id, // Id product + //print "XXX We add id=".$id." - label=".$label." - nb=".$nb." - multiply=".$multiply." fullpath=".$compl_path.$label."\n"; + $this->fetch($id); + $this->load_stock(); + $this->res[]= array( + 'id'=>$id, // Id product 'nb'=>$nb, // Nb of units that compose parent product - 'nb_total'=>$nb, // Nb of units for all nb of product - 'stock'=>$this->stock_warehouse[1]->real, // Stock + 'nb_total'=>$nb*$multiply, // Nb of units for all nb of product + 'stock'=>$this->stock_warehouse[1]->real, // Stock 'stock_alert'=>$this->seuil_stock_alerte, // Stock alert - 'fullpath' => $compl_path.$nom_pere, // Label - 'type'=>$type // Nb of units that compose parent product - ); - } - } - else if($nom_pere != "0" && $nom_pere != "1") - { - $this->res[]= array($compl_path.$nom_pere,$desc_pere); + 'fullpath' => $compl_path.$label, // Label + 'type'=>$type // Nb of units that compose parent product + ); } // Recursive call if child is an array - if (is_array($desc_pere[0])) + if (is_array($desc_pere['childs'])) { - $this ->fetch_prod_arbo($desc_pere[0], $nom_pere." -> ", $desc_pere[1]*$multiply, $level+1); + //print 'YYY We go down for '.$desc_pere[3]." -> \n"; + $this ->fetch_prod_arbo($desc_pere['childs'], $compl_path.$desc_pere[3]." -> ", $desc_pere[1]*$multiply, $level+1); } } } @@ -2227,11 +2200,12 @@ class Product extends CommonObject $this->res = array(); if (isset($this->sousprods) && is_array($this->sousprods)) { - foreach($this->sousprods as $nom_pere => $desc_pere) + foreach($this->sousprods as $prod_name => $desc_product) { - if (is_array($desc_pere)) $this->fetch_prod_arbo($desc_pere,"",$multiply); + if (is_array($desc_product)) $this->fetch_prod_arbo($desc_product,"",$multiply); } } + //var_dump($this->res); return $this->res; } @@ -2292,7 +2266,7 @@ class Product extends CommonObject /** - * Return all parent products fo current product + * Return all direct parent products fo current product * * @return array prod */ @@ -2323,31 +2297,34 @@ class Product extends CommonObject } /** - * Return childs of prodcut with if fk_parent + * Return childs of product $id * - * @param int $fk_parent Id of product to search childs of + * @param int $id Id of product to search childs of * @return array Prod */ - function getChildsArbo($fk_parent) + function getChildsArbo($id) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= ", ".MAIN_DB_PREFIX."product_association as pa"; $sql.= " WHERE p.rowid = pa.fk_product_fils"; - $sql.= " AND pa.fk_product_pere = ".$fk_parent; + $sql.= " AND pa.fk_product_pere = ".$id; + $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens + dol_syslog(get_class($this).'::getChildsArbo sql='.$sql); $res = $this->db->query($sql); if ($res) { $prods = array(); while ($rec = $this->db->fetch_array($res)) { + $prods[$rec['rowid']]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type'],3=>$this->db->escape($rec['label'])); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); - $prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); + //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); $listofchilds=$this->getChildsArbo($rec['id']); foreach($listofchilds as $keyChild => $valueChild) { - $prods[$this->db->escape($rec['label'])][$keyChild] = $valueChild; + $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; } } @@ -2369,14 +2346,14 @@ class Product extends CommonObject function get_sousproduits_arbo() { $parent = $this->getParent(); - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value[0]=id { foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) { $parent[$key][$keyChild] = $valueChild; } } - foreach($parent as $key => $value) + foreach($parent as $key => $value) // key=label, value is array of childs { $this->sousprods[$key] = $value; } From b9dab6d059d6f3abcd8557ef313171a92b0b964b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 13:57:24 +0200 Subject: [PATCH 02/16] Fix: Korting --- htdocs/langs/nl_NL/bills.lang | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/nl_NL/bills.lang b/htdocs/langs/nl_NL/bills.lang index bc238882ecc..17880cd10af 100644 --- a/htdocs/langs/nl_NL/bills.lang +++ b/htdocs/langs/nl_NL/bills.lang @@ -223,9 +223,9 @@ ExportDataset_invoice_1 = Afnemersfacturen en factuurregels ExportDataset_invoice_2 = Afnemersfacturen en -betalingen ProformaBill = Proforma factuur: Reduction = Vermindering -ReductionShort = Minder +ReductionShort = Korting Reductions = Verminderingen -ReductionsShort = Minder +ReductionsShort = Korting Discount = Korting Discounts = Kortingen ShowDiscount = Toon korting From 88fe3e86f241a5694329f3395d54121a71135ebf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 14:01:47 +0200 Subject: [PATCH 03/16] Missing translation --- htdocs/langs/fr_FR/admin.lang | 4 ++-- htdocs/langs/fr_FR/externalsite.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 51966eebcf2..2bff0050348 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -45,8 +45,8 @@ ErrorModuleRequireDolibarrVersion= Erreur, ce module requiert une version %s ou ErrorDecimalLargerThanAreForbidden= Erreur, les précisions supérieures à %s ne sont pas supportées. DictionnarySetup= Dictionnaires Dictionnary= Dictionnaires -ErrorReservedTypeSystemSystemAuto= -ErrorCodeCantContainZero= +ErrorReservedTypeSystemSystemAuto=Erreur, La valeur 'system' et 'systemauto' est réservée. +ErrorCodeCantContainZero=Erruer, le code ne peut contenir la valeur 0 DisableJavascript= Désactiver les fonctions Javascript et Ajax ConfirmAjax= Utiliser les popups de confirmation Ajax UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).

Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. diff --git a/htdocs/langs/fr_FR/externalsite.lang b/htdocs/langs/fr_FR/externalsite.lang index 36c8686a3c3..e41bab65bbd 100644 --- a/htdocs/langs/fr_FR/externalsite.lang +++ b/htdocs/langs/fr_FR/externalsite.lang @@ -2,4 +2,4 @@ CHARSET=UTF-8 ExternalSiteSetup=Configuration du lien vers le site externe ExternalSiteURL=URL du site externe -ExternalSiteModuleNotComplete= \ No newline at end of file +ExternalSiteModuleNotComplete=La configuration du module "Lien externe" est incomplète. \ No newline at end of file From 63a5aee80e06d7fde214e8af7b8958192fd52779 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 12:35:31 +0200 Subject: [PATCH 04/16] Fix: broken features for fileupload --- htdocs/comm/action/document.php | 2 +- htdocs/core/class/fileupload.class.php | 28 +++++++++++++++++++++++++- htdocs/projet/class/task.class.php | 1 + htdocs/projet/tasks/document.php | 8 ++++++-- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 9fcbca3e743..042f330b199 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -263,7 +263,7 @@ if ($objectid > 0) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index c5e83017940..a86073e6969 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -56,6 +56,8 @@ class FileUpload $filename = $regs[2]; } + $parentForeignKey = ''; + // For compatibility if ($element == 'propal') { $pathname = 'comm/propal'; @@ -69,6 +71,14 @@ class FileUpload $element = $pathname = 'projet'; $dir_output=$conf->$element->dir_output; } + elseif ($element == 'project_task') { + $pathname = 'projet'; $filename='task'; + $dir_output=$conf->projet->dir_output; + $parentForeignKey = 'fk_project'; + $parentClass = 'Project'; + $parentElement = 'projet'; + $parentObject = 'project'; + } elseif ($element == 'fichinter') { $element='ficheinter'; $dir_output=$conf->$element->dir_output; @@ -80,6 +90,10 @@ class FileUpload elseif ($element == 'invoice_supplier') { $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; + } + elseif ($element == 'action') { + $pathname = 'comm/action'; $filename='actioncomm'; + $dir_output=$conf->agenda->dir_output; } else { $dir_output=$conf->$element->dir_output; } @@ -97,11 +111,23 @@ class FileUpload $object = new $classname($db); $object->fetch($fk_element); - $object->fetch_thirdparty(); + if (!empty($parentForeignKey)) { + dol_include_once('/'.$parentElement.'/class/'.$parentObject.'.class.php'); + $parent = new $parentClass($db); + $parent->fetch($object->$parentForeignKey); + if (!empty($parent->socid)) { + $parent->fetch_thirdparty(); + } + $object->$parentObject = dol_clone($parent); + } else { + $object->fetch_thirdparty(); + } $object_ref = dol_sanitizeFileName($object->ref); if ($element == 'invoice_supplier') { $object_ref = get_exdir($object->id, 2) . $object_ref; + } else if ($element == 'project_task') { + $object_ref = $object->project->ref . '/' . $object_ref; } $this->options = array( diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f28e5d27e6d..12571aad64a 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -171,6 +171,7 @@ class Task extends CommonObject $sql.= " t.label,"; $sql.= " t.description,"; $sql.= " t.duration_effective,"; + $sql.= " t.datec,"; $sql.= " t.dateo,"; $sql.= " t.datee,"; $sql.= " t.fk_user_creat,"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 5d42a44d54b..90adc2925c2 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -93,7 +93,11 @@ if ($id > 0 || ! empty($ref)) { $projectstatic->fetch($object->fk_project); - if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); + if (! empty($projectstatic->socid)) { + $projectstatic->fetch_thirdparty(); + } + + $object->project = dol_clone($projectstatic); $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } @@ -114,7 +118,7 @@ if ($action=='delete') { $langs->load("other"); $file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); From 5ccb4108d4d8bdbd9645d47406a6496be73a8deb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 14:47:37 +0200 Subject: [PATCH 05/16] Fix: merge problem --- htdocs/comm/action/document.php | 323 ++++++++++++++++---------------- 1 file changed, 162 insertions(+), 161 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 042f330b199..6a576c580ca 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -51,6 +51,19 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +$act = new ActionComm($db); + +if ($objectid > 0) +{ + $ret = $act->fetch($objectid); + if ($ret > 0) { + $company=new Societe($db); + $company->fetch($act->societe->id); + $act->societe=$company; // For backward compatibility + $act->thirdparty=$company; + } +} + // Get parameters $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); @@ -79,7 +92,7 @@ if ($action == 'delete') { $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); $file = $upload_dir . '/' . $_GET['urlfile']; // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$act); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); $action=''; @@ -96,184 +109,172 @@ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); -if ($objectid > 0) +if ($act->id > 0) { - $act = new ActionComm($db); - if ($act->fetch($objectid)) + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + + $author=new User($db); + $author->fetch($act->author->id); + $act->author=$author; + + if ($act->contact->id) $act->fetch_contact($act->contact->id); + + $head=actions_prepare_head($act); + dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + + // Affichage fiche action en mode visu + print ''; + + $linkback = ''.$langs->trans("BackToList").''; + + // Ref + print ''; + + // Type + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($objectid); + print ''; + } - $company=new Societe($db); - $company->fetch($act->societe->id); - $act->societe=$company; + // Title + print ''; - $author=new User($db); - $author->fetch($act->author->id); - $act->author=$author; + // Full day event + print ''; - if ($act->contact->id) $act->fetch_contact($act->contact->id); + // Date start + print ''; + print ''; + print ''; - $head=actions_prepare_head($act); - dol_fiche_head($head, 'documents', $langs->trans("Action"),0,'action'); + // Date end + print ''; - // Affichage fiche action en mode visu - print '
'.$langs->trans("Ref").''; + print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); + print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; + if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); + else print dol_print_date($act->datep,'day'); + if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); + print ''."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendar').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; + print '
'."\n"; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; + print '
'."\n"; + print '
'.$langs->trans("DateActionEnd").''; + if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); + else print dol_print_date($act->datef,'day'); + if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); + print '
'; + // Status + print ''; - $linkback = ''.$langs->trans("BackToList").''; + // Location + print ''; - // Ref - print ''; - // Type - if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Ref").''; - print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '


'; + + + // Third party - Contact + print ''; + print "
".dol_print_phone($act->societe->tel); } - - // Title - print ''; - - // Full day event - print ''; - - // Date start - print ''; - print ''; - print ''; - - // Date end - print ''; - - // Status - print ''; - - // Location - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + if ($act->societe->id && $act->type_code == 'AC_TEL') + { + if ($act->societe->fetch($act->societe->id)) { - print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; - if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); - else print dol_print_date($act->datep,'day'); - if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); - print ''."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; - print '
'."\n"; - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; - print '
'."\n"; - print '
'.$langs->trans("DateActionEnd").''; - if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); - else print dol_print_date($act->datef,'day'); - if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $act->getLibStatut(4); - print '
'.$langs->trans("Location").''.$act->location.'


'; - - - // Third party - Contact - print ''; - print ''; - print ''; - - // Project - if (! empty($conf->projet->enabled)) - { - print ''; - } - - // Priority - print ''; - - - print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); - if ($act->societe->id && $act->type_code == 'AC_TEL') - { - if ($act->societe->fetch($act->societe->id)) - { - print "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - if ($act->contact->id > 0) - { - print $act->contact->getNomUrl(1); - if ($act->contact->id && $act->type_code == 'AC_TEL') - { - if ($act->contact->fetch($act->contact->id)) - { - print "
".dol_print_phone($act->contact->phone_pro); - } - } - } - else - { - print $langs->trans("None"); - } - - print '
'.$langs->trans("Project").''; - if ($act->fk_project) - { - $project=new Project($db); - $project->fetch($act->fk_project); - print $project->getNomUrl(1); - } - print '
'.$langs->trans("Priority").''; - print ($act->priority?$act->priority:''); - print '


'; - - // Construit liste des fichiers - $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $totalsize=0; - foreach($filearray as $key => $file) + } + print ''; + print ''; + print ''; - print ''; - print '
'.$langs->trans("Contact").''; + if ($act->contact->id > 0) + { + print $act->contact->getNomUrl(1); + if ($act->contact->id && $act->type_code == 'AC_TEL') { - $totalsize+=$file['size']; + if ($act->contact->fetch($act->contact->id)) + { + print "
".dol_print_phone($act->contact->phone_pro); + } } - - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print ''; - - - // Affiche formulaire upload - $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); - - - // List of document - $param='&id='.$act->id; - $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { - dol_print_error($db); + print $langs->trans("None"); } + + print ''; + + // Project + if (! empty($conf->projet->enabled)) + { + print ''.$langs->trans("Project").''; + if ($act->fk_project) + { + $project=new Project($db); + $project->fetch($act->fk_project); + print $project->getNomUrl(1); + } + print ''; + } + + // Priority + print ''.$langs->trans("Priority").''; + print ($act->priority?$act->priority:''); + print ''; + + + print '

'; + + // Construit liste des fichiers + $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $totalsize=0; + foreach($filearray as $key => $file) + { + $totalsize+=$file['size']; + } + + + print ''; + print ''; + print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; + + print ''; + + + // Affiche formulaire upload + $formfile=new FormFile($db); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create),50,$act); + + + // List of document + $param='&id='.$act->id; + $formfile->list_of_documents($filearray,$act,'actions',$param,0,'',$user->rights->agenda->myactions->create); } else { From ccf809b14aca83272451863534d767dc80291df1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:09:19 +0200 Subject: [PATCH 06/16] Fix: broken features --- htdocs/compta/sociales/class/chargesociales.class.php | 2 +- htdocs/compta/sociales/document.php | 4 ++-- htdocs/core/class/fileupload.class.php | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6fbd0a23143..f62b2fcc594 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class ChargeSociales extends CommonObject { - public $element='rowid'; + public $element='chargesociales'; public $table='chargesociales'; public $table_element='chargesociales'; diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index dcb082b41d7..452de21285a 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -79,7 +79,7 @@ if (GETPOST("sendit") && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($action == 'delete') { $file = $upload_dir . '/' . GETPOST("urlfile"); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP). - $ret=dol_delete_file($file); + $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } @@ -172,7 +172,7 @@ if ($object->id) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id,'',0,0,$user->rights->tax->charges->creer,50,$object); // List of document diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index a86073e6969..6bb5b9209d1 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -94,6 +94,10 @@ class FileUpload elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; + } + elseif ($element == 'chargesociales') { + $pathname = 'compta/sociales'; $filename='chargesociales'; + $dir_output=$conf->tax->dir_output; } else { $dir_output=$conf->$element->dir_output; } From 7217d91f132b76b14ccaf5541e07e23755fd13ee Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 15:26:14 +0200 Subject: [PATCH 07/16] Fix: missing commit --- htdocs/core/class/fileupload.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 6bb5b9209d1..910ad55e0a0 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -91,6 +91,9 @@ class FileUpload $pathname = 'fourn'; $filename='fournisseur.facture'; $dir_output=$conf->fournisseur->facture->dir_output; } + elseif ($element == 'product') { + $dir_output = $conf->product->multidir_output[$conf->entity]; + } elseif ($element == 'action') { $pathname = 'comm/action'; $filename='actioncomm'; $dir_output=$conf->agenda->dir_output; From f8ddd69ccbb84db596f31b7a08b46fd2bd6f3d17 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Apr 2013 16:42:44 +0200 Subject: [PATCH 08/16] FIXME regresion if code with not in numeric base --- htdocs/admin/dict.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5a4db149b87..779a7da96f5 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -448,11 +448,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=0; $msg.= $langs->transnoentities('ErrorCodeCantContainZero').'
'; } - if (!is_numeric($_POST['code'])) + // FIXME regresion if code with not in numeric base + /*if (!is_numeric($_POST['code'])) { $ok = 0; $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
'; - } + }*/ } if (isset($_POST["pays"]) && $_POST["pays"]=='0') { $ok=0; From c8b2ce3d8ec9f4271e380257bd1728c4ddac4d93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Apr 2013 20:46:53 +0200 Subject: [PATCH 09/16] Removed warning --- htdocs/core/modules/modBanque.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 1bae9f61129..4b9f5f060b3 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -159,7 +159,7 @@ class modBanque extends DolibarrModules $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON bu.url_id = s.rowid'; $this->export_sql_end[$r] .=' WHERE ba.rowid = b.fk_account'; $this->export_sql_end[$r] .=' AND ba.entity = '.$conf->entity; - $this->export_sql_order[$r] .=' ORDER BY b.datev, b.num_releve'; + $this->export_sql_order[$r] =' ORDER BY b.datev, b.num_releve'; } From ff3b2933a817df4255b3448cbe8ed84ad46871cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 10:42:10 +0200 Subject: [PATCH 10/16] Fix: Removed bad test --- test/phpunit/DateLibTest.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/test/phpunit/DateLibTest.php b/test/phpunit/DateLibTest.php index 15da662b92e..1b35809e0af 100644 --- a/test/phpunit/DateLibTest.php +++ b/test/phpunit/DateLibTest.php @@ -304,19 +304,5 @@ class DateLibTest extends PHPUnit_Framework_TestCase return $result; } - /** - * testDolGetFirstDay - * - * @return void - */ - public function testDolGetFirstDay() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - } } ?> \ No newline at end of file From 3f1f065d4ecb212bc5b4825dc059ffdbac474aee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:02:56 +0200 Subject: [PATCH 11/16] Fix: log must use the mask defined into setup Conflicts: htdocs/core/modules/syslog/mod_syslog_file.php --- htdocs/core/modules/syslog/mod_syslog_file.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/syslog/mod_syslog_file.php b/htdocs/core/modules/syslog/mod_syslog_file.php index b0e1bd550b4..4d482f017cf 100644 --- a/htdocs/core/modules/syslog/mod_syslog_file.php +++ b/htdocs/core/modules/syslog/mod_syslog_file.php @@ -96,7 +96,12 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface /** * Return the parsed logfile path * +<<<<<<< OURS * @return string +======= + * @param string $suffixinfilename When output is a file, append this suffix into default log filename. + * @return string +>>>>>>> THEIRS */ private function getFilename() { @@ -111,6 +116,8 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface */ public function export($content) { + global $conf; + $logfile = $this->getFilename(); if (defined("SYSLOG_FILE_NO_ERROR")) $filefd = @fopen($logfile, 'a+'); @@ -142,6 +149,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface fwrite($filefd, $message."\n"); fclose($filefd); + @chmod($logfile, octdec($conf->global->MAIN_UMASK)); } } -} \ No newline at end of file +} From dbc2eddcbacbb4721ff61d0fba3160dac3da8c4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:09:21 +0200 Subject: [PATCH 12/16] Prepare for 3.3.2 --- build/debian/changelog | 4 ++-- build/doxygen/dolibarr-doxygen.doxyfile | 2 +- build/exe/doliwamp/doliwamp.iss | 6 +++--- build/makepack-dolibarr.pl | 2 +- build/makepack-howto.txt | 2 +- build/perl/virtualmin/dolibarr.pl | 2 +- build/rpm/dolibarr_fedora.spec | 2 +- build/rpm/dolibarr_generic.spec | 2 +- build/rpm/dolibarr_mandriva.spec | 2 +- build/rpm/dolibarr_opensuse.spec | 2 +- htdocs/filefunc.inc.php | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/build/debian/changelog b/build/debian/changelog index 4382b1ae605..b9302cfc624 100644 --- a/build/debian/changelog +++ b/build/debian/changelog @@ -1,9 +1,9 @@ -dolibarr (3.3.1+nmu1) unstable; urgency=low +dolibarr (3.3.2+nmu1) unstable; urgency=low * Non-maintainer upload. * New upstream release. closes: bug#634783 - -- Dolibarr team Sat, 2 Mar 2013 12:00:00 +0100 + -- Dolibarr team Mon, 22 Apr 2013 12:00:00 +0100 # For a changelog file dedicated to end users, see /usr/share/doc/dolibarr/ChangeLog.gz \ No newline at end of file diff --git a/build/doxygen/dolibarr-doxygen.doxyfile b/build/doxygen/dolibarr-doxygen.doxyfile index 690b5daf1a2..294541450fb 100644 --- a/build/doxygen/dolibarr-doxygen.doxyfile +++ b/build/doxygen/dolibarr-doxygen.doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = dolibarr # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 3.3.0 +PROJECT_NUMBER = 3.3.2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index dc202fdd371..4f9b0fabea6 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -17,9 +17,9 @@ ; ----- Change this ----- AppName=DoliWamp ; DoliWamp-x.x.x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -AppVerName=DoliWamp-3.3.1 +AppVerName=DoliWamp-3.3.2 ; DoliWamp-x.x x or DoliWamp-x.x.x-alpha or DoliWamp-x.x.x-beta or DoliWamp-x.x.x-rc or DoliWamp-x.x.x -OutputBaseFilename=DoliWamp-3.3.1 +OutputBaseFilename=DoliWamp-3.3.2 ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory ;SourceDir=C:\Documents and Settings\ldestailleur\git\dolibarr_old @@ -33,7 +33,7 @@ AppPublisherURL=http://www.nltechno.com AppSupportURL=http://www.dolibarr.org AppUpdatesURL=http://www.dolibarr.org AppComments=DoliWamp includes Dolibarr, Apache, PHP and Mysql softwares. -AppCopyright=Copyright (C) 2008-2012 Laurent Destailleur, NLTechno +AppCopyright=Copyright (C) 2008-2013 Laurent Destailleur, NLTechno DefaultDirName=c:\dolibarr DefaultGroupName=Dolibarr ;LicenseFile=COPYING diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c2e8a0eda1a..f8fcdd762c4 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -10,7 +10,7 @@ use Cwd; $PROJECT="dolibarr"; $MAJOR="3"; $MINOR="3"; -$BUILD="1"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate +$BUILD="2"; # Mettre x pour release, x-dev pour dev, x-beta pour beta, x-rc pour release candidate $RPMSUBVERSION="auto"; # auto use value found into BUILD @LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index fad028cfbf6..4847b0102ef 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -32,7 +32,7 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in /ChangeLog and /filefunc.inc.php +- Update version/info in ChangeLog - Update version number with x.x.x in htdocs/filefunc.inc.php - Update version number with x.x.x in build/makepack-dolibarr.pl - Update version number with x.x.x in build/debian/changelog diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index 1bc5f350954..0ede11d9968 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -30,7 +30,7 @@ return "Regis Houssin"; # script_dolibarr_versions() sub script_dolibarr_versions { -return ( "3.3.0", "3.2.1", "3.1.1" ); +return ( "3.3.2", "3.3.1", "3.3.0", "3.2.1", "3.1.1" ); } sub script_dolibarr_category diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index e2e1299a9df..41dff2735ff 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -333,5 +333,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index dbd2a26686a..9fe677e6f42 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -522,5 +522,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index 4701ff2651e..f31988aed20 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -322,5 +322,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index c5bde7c5427..3c59a8a075c 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -333,5 +333,5 @@ fi %changelog -* Sun Feb 17 2013 Laurent Destailleur 3.3.1-0.3 +* Mon Apr 22 2013 Laurent Destailleur 3.3.2-0.3 - Initial version (#723326) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index a8dba530b21..dd3b9981fce 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.1'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.3.2'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From 8f502b8cfc2dec020ce7d33c0e01398bc9512b66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:39:55 +0200 Subject: [PATCH 13/16] Prepare 3.3.2 --- build/debian/README.howto | 2 +- build/debian/po/fr.po | 12 ++++++------ build/debian/po/templates.pot | 15 ++++++++------- build/debian/rules | 3 +++ build/makepack-dolibarr.pl | 2 ++ 5 files changed, 20 insertions(+), 14 deletions(-) mode change 100755 => 100644 build/debian/po/templates.pot diff --git a/build/debian/README.howto b/build/debian/README.howto index 9c3dbc9ad07..b281c20b13b 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -13,7 +13,7 @@ with format .DEB (for Debian, Ubuntu, ...). # This is standard command to work on Debian packaging: # -# gpg --gen-key Generate a GPG key +# gpg --gen-key Generate a GPG key (-> pubring.gpg + secring.gpg) # # debconf-updatepo To run into po dir to regenate templates.pot # podebconf-report-po --from email@email.com To send email to ask translations diff --git a/build/debian/po/fr.po b/build/debian/po/fr.po index a96cd360299..d23da598297 100755 --- a/build/debian/po/fr.po +++ b/build/debian/po/fr.po @@ -14,8 +14,8 @@ msgid "" msgstr "" "Project-Id-Version: 1.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: 2011-07-29 22:45+0100\n" "Last-Translator: Laurent Destailleur \n" "Language-Team: Laurent Destailleur \n" @@ -27,13 +27,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "Seveur web à reconfigurer automatiquement:" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -44,14 +44,14 @@ msgstr "" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "Effacer la base de donnée et les fichiers uploadés ?" # #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "Answer if you want to removed the Dolibarr MySQL database and all other " "datas (datas related to this question are the Dolibarr DBMS account, all " diff --git a/build/debian/po/templates.pot b/build/debian/po/templates.pot old mode 100755 new mode 100644 index 8813bd2d45b..90b57278e04 --- a/build/debian/po/templates.pot +++ b/build/debian/po/templates.pot @@ -3,11 +3,12 @@ # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-01 18:17+0200\n" +"Project-Id-Version: dolibarr\n" +"Report-Msgid-Bugs-To: dolibarr@packages.debian.org\n" +"POT-Creation-Date: 2013-04-23 12:16+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,13 +19,13 @@ msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "Web server to reconfigure automatically:" msgstr "" #. Type: multiselect #. Description -#: ../templates:1001 +#: ../dolibarr.templates:1001 msgid "" "Please choose the web server that should be automatically configured to run " "dolibarr." @@ -32,13 +33,13 @@ msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "Delete database and uploaded files ?" msgstr "" #. Type: boolean #. Description -#: ../templates:2001 +#: ../dolibarr.templates:2001 msgid "" "Answer if you want to removed the Dolibarr MySQL database and all other " "datas (datas related to this question are the Dolibarr DBMS account, all " diff --git a/build/debian/rules b/build/debian/rules index 6b75c68b85d..e36aa8f0545 100755 --- a/build/debian/rules +++ b/build/debian/rules @@ -112,6 +112,9 @@ clean: rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919 rm -fr htdocs/includes/tcpdf/fonts/utils + # clean from files to avoid warning of missing dependencies + rm -fr htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.py + # Licence files are included into copyright file. rm -fr htdocs/includes/phpexcel/license.txt rm -f htdocs/includes/tcpdf/LICENSE.TXT diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f8fcdd762c4..ee44ac8a493 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -656,6 +656,8 @@ if ($nboftargetok) { $ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.php`; $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; "; $ret=`$cmd`; + $cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; "; + $ret=`$cmd`; print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n"; From 624a039eaf08f23b6292995b58497d36ecacbad1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 12:58:58 +0200 Subject: [PATCH 14/16] Update debian doc --- build/debian/README.howto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/debian/README.howto b/build/debian/README.howto index b281c20b13b..797e653bc27 100644 --- a/build/debian/README.howto +++ b/build/debian/README.howto @@ -43,10 +43,11 @@ To submit a package to Debian: See page http://www.debian.org/devel/wnpp/#l1 for example of ITP requests contents. - Wait until you received bug number. -For first ITP submission of Dolibarr, bug id was 634783. + For first ITP submission of Dolibarr, bug id was 634783. -- Check bug is into database by searching with id on http://www.debian.org/Bugs/ - +- Check bug is into database by searching with id on + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634783 + - Add a line for upstream into file changelog with bug number - Call for a mentor on ML debian-mentors to upload packages From 57ab4fb7983ea517d551bb899781cb1185fe42df Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 13:38:00 +0200 Subject: [PATCH 15/16] Fix doc --- build/launchpad/README | 79 +++++++++++++++++++++++++++--------------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index 2a1e7d138ca..37c1c51f96a 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -28,6 +28,8 @@ a package onto LaunchPad - Edit file ~/.bashrc to add DEBFULLNAME="" DEBEMAIL="" +- Create a Bazaar directory + mkdir bzr If you want to build/test package locally: - Create a file ~/.pbuilderrc with content @@ -36,24 +38,43 @@ If you want to build/test package locally: sudo pbuilder create [--distribution sid|squeeze] -# Push/declare sources to Launchpad +# Push/declare Dolibarr sources to Launchpad #---------------------------------- - -- Create a Bazaar directory - mkdir bzr -- Create a series - Call it 'dev' or 'stable' - For stable: Add file with *: http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_3.2.*.tar.gz - For dev: Configure Series branch - Link to series +- From Launchpad project (https://launchpad.net/dolibarr), register a series: + Call it 'trunk' or 'beta' or 'stable' + Use branch (dev): + ~eldy/dolibarr/develop + ~eldy/dolibarr/beta + ~eldy/dolibarr/stable + or + Use URL pattern (beta or stable): + http://www.dolibarr.org/files/lastbuild/package_debian-ubuntu/dolibarr_x.z.*.tar.gz + http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_x.y.*.tar.gz + +- For Dev, you can also add link serie to GIT HEAD. +- For beta and stable, you can init from command line + cd bzr/dolibarr-[beta|stable] bzr init bzr add bzr commit -m "Init" - bzr push lp:~yourlogin/dolibarr/stable + bzr push lp:~yourlogin/dolibarr/[beta|stable] -# Init repository of sources into launchpad (when repository for sources does not exist) +- List of series are visible here: https://launchpad.net/dolibarr/+series + +# To update Dolibarr into launchpad (when repository for sources already exists) #---------------------------------- + cd bzr + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr status + -- Update files here -- + bzr commit -m "Description of change" + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] -- Create debian directory and upload it onto bzr branch ~yourlogin/+junk/debian-[dev|stable] + + +# Init debian dir repository into launchpad (when repository for sources does not exist) +#---------------------------------- +- Create debian directory and upload it onto bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] cd bzr mkdir debian cd debian @@ -61,24 +82,28 @@ If you want to build/test package locally: bzr init bzr add bzr commit -m "Init control files" - bzr push lp:~yourlogin/+junk/debian-[dev|stable] (put here any branch name) - or download it from launchpad bazaar: + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] (put here any branch name) +- or download it from launchpad bazaar: cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|stable] -- To update this debian directory, edit files into the bzr dir and run - bzr status - bzr commit -m "Description of change" - bzr push lp:~yourlogin/+junk/debian-[dev|stable] + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] -# Get repository of sources from launchpad (when repository for sources already exists) +# Get debian dir repository from launchpad (when repository for sources already exists) #---------------------------------- cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|stable] + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + +# To update debian dir into launchpad (when repository for sources already exists) +#---------------------------------- + cd bzr + bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr status + -- Update files here -- + bzr commit -m "Description of change" + bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] # Define a recipe into launchpad (a rule to build packages into a PPA) #---------------------------------- - - Create a file dolibarr.recipe with content cd bzr vi dolibarr.recipe @@ -101,11 +126,11 @@ If you want to build/test package locally: # To get/download package from PPA: #---------------------------------- -Add signing key of the Launchpad repository: +- Add signing key of the Launchpad repository: > gpg --keyserver keyserver.ubuntu.com --recv-key A38BF8FD > sudo apt-key add ~/.gnupg/pubring.gpg -Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list +- Add Dolibarr Launchpad repository to your system setup by adding the two lines to /etc/apt/sources.list For the development snapshot version: deb http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-dev/ubuntu precise main @@ -113,12 +138,10 @@ For the stable version: deb http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main deb-src http://ppa.launchpad.net/yourlogin/dolibarr-stable/ubuntu precise main -Update your package cache: +- Update your package cache: > apt-get update -Install Dolibarr: +- Install Dolibarr: > apt-get install dolibarr - - - + From 365a5e18e859148e532b57c21ab503628b7637de Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Apr 2013 13:56:59 +0200 Subject: [PATCH 16/16] Prepare 3.3.2 --- build/launchpad/README | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/launchpad/README b/build/launchpad/README index 37c1c51f96a..dbf2dbdb4f1 100644 --- a/build/launchpad/README +++ b/build/launchpad/README @@ -64,12 +64,12 @@ If you want to build/test package locally: # To update Dolibarr into launchpad (when repository for sources already exists) #---------------------------------- cd bzr - bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + bzr branch lp:~yourlogin/dolibarr/[dev|beta|stable] + cd dolibarr-[dev|beta|stable] bzr status -- Update files here -- bzr commit -m "Description of change" - bzr push lp:~yourlogin/+junk/debian-[dev|beta|stable] - + bzr push # Init debian dir repository into launchpad (when repository for sources does not exist) @@ -96,6 +96,7 @@ If you want to build/test package locally: #---------------------------------- cd bzr bzr branch lp:~yourlogin/+junk/debian-[dev|beta|stable] + cd debian-[dev|beta|stable] bzr status -- Update files here -- bzr commit -m "Description of change"