diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 98defa55406..81e648c2710 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2003 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,7 +156,16 @@ class Fichinter extends CommonObject if ($result) { $this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."fichinter"); - + + if ($this->id) + { + $this->ref='(PROV'.$this->id.')'; + $sql = 'UPDATE '.MAIN_DB_PREFIX."fichinter SET ref='".$this->ref."' WHERE rowid=".$this->id; + + dol_syslog(get_class($this)."::create sql=".$sql); + $resql=$this->db->query($sql); + if (! $resql) $error++; + } // Add linked object if (! $error && $this->origin && $this->origin_id) { @@ -357,9 +366,20 @@ class Fichinter extends CommonObject $this->db->begin(); $now=dol_now(); + + // Define new ref + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref))) + { + $num = $this->getNextNumRef($soc); + } + else + { + $num = $this->ref; + } $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter"; $sql.= " SET fk_statut = 1"; + $sql.= ", ref = '".$num."'"; $sql.= ", date_valid = ".$this->db->idate($now); $sql.= ", fk_user_valid = ".$user->id; $sql.= " WHERE rowid = ".$this->id; diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index b2db591eefc..b67c2a0df16 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -2,7 +2,7 @@ /* Copyright (C) 2002-2007 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2011-2012 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -917,8 +917,8 @@ if ($action == 'create') $obj = $conf->global->FICHEINTER_ADDON; $obj = "mod_".$obj; - $modFicheinter = new $obj; - $numpr = $modFicheinter->getNextValue($soc, $object); + //$modFicheinter = new $obj; + //$numpr = $modFicheinter->getNextValue($soc, $object); if ($socid > 0) { @@ -935,8 +935,7 @@ if ($action == 'create') print ''; // Ref - print ''.$langs->trans("Ref").''; - print ''."\n"; + print ''.$langs->trans('Ref').''.$langs->trans("Draft").''; // Description (must be a textarea and not html must be allowed (used in list view) print ''.$langs->trans("Description").''; @@ -1053,7 +1052,24 @@ else if ($id > 0 || ! empty($ref)) // Confirmation validation if ($action == 'validate') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $langs->trans('ConfirmValidateIntervention'), 'confirm_validate','',0,1); + // on verifie si l'objet est en numerotation provisoire + $ref = substr($object->ref, 1, 4); + if ($ref == 'PROV') + { + $numref = $object->getNextNumRef($soc); + if (empty($numref)) + { + $error++; + dol_htmloutput_errors($object->error); + } + } + else + { + $numref = $object->ref; + } + $text=$langs->trans('ConfirmValidateIntervention',$numref); + + $ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1); if ($ret == 'html') print '
'; } diff --git a/htdocs/langs/ca_ES/interventions.lang b/htdocs/langs/ca_ES/interventions.lang index 3344661a2b4..e55fed93245 100644 --- a/htdocs/langs/ca_ES/interventions.lang +++ b/htdocs/langs/ca_ES/interventions.lang @@ -18,7 +18,7 @@ ValidateIntervention=Validar intervenció ModifyIntervention=Modificar intervenció DeleteInterventionLine=Eliminar línia d'intervenció ConfirmDeleteIntervention=Esteu segur de voler eliminar aquesta intervenció? -ConfirmValidateIntervention=Esteu segur de voler validar aquesta intervenció? +ConfirmValidateIntervention=Esteu segur de voler validar aquesta intervenció sota la referència %s? ConfirmModifyIntervention=Esteu segur de voler modificar aquesta intervenció? ConfirmDeleteInterventionLine=Esteu segur de voler eliminar aquesta línia? NameAndSignatureOfInternalContact=Nom i signatura del participant: diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 117a3481bae..43bd94adc8f 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -18,7 +18,7 @@ ValidateIntervention=Validate intervention ModifyIntervention=Modify intervention DeleteInterventionLine=Delete intervention line ConfirmDeleteIntervention=Are you sure you want to delete this intervention ? -ConfirmValidateIntervention=Are you sure you want to validate this intervention ? +ConfirmValidateIntervention=Are you sure you want to validate this intervention under name %s ? ConfirmModifyIntervention=Are you sure you want to modify this intervention ? ConfirmDeleteInterventionLine=Are you sure you want to delete this intervention line ? NameAndSignatureOfInternalContact=Name and signature of intervening : diff --git a/htdocs/langs/es_ES/interventions.lang b/htdocs/langs/es_ES/interventions.lang index c7833a669d8..52cb517aea2 100644 --- a/htdocs/langs/es_ES/interventions.lang +++ b/htdocs/langs/es_ES/interventions.lang @@ -18,7 +18,7 @@ ValidateIntervention=Validar intervención ModifyIntervention=Modificar intervención DeleteInterventionLine=Eliminar línea de intervención ConfirmDeleteIntervention=¿Está seguro de querer eliminar esta intervención? -ConfirmValidateIntervention=¿Está seguro de querer validar esta intervención? +ConfirmValidateIntervention=¿Está seguro de querer validar esta intervención bajo la referencia %s? ConfirmModifyIntervention=¿Está seguro de querer modificar esta intervención? ConfirmDeleteInterventionLine=¿Está seguro de querer eliminar esta linea? NameAndSignatureOfInternalContact=Nombre y firma del participante: diff --git a/htdocs/langs/fr_FR/interventions.lang b/htdocs/langs/fr_FR/interventions.lang index a4089d2b66e..7b76224f444 100644 --- a/htdocs/langs/fr_FR/interventions.lang +++ b/htdocs/langs/fr_FR/interventions.lang @@ -18,7 +18,7 @@ ValidateIntervention=Valider intervention ModifyIntervention=Modifier intervention DeleteInterventionLine=Supprimer ligne d'intervention ConfirmDeleteIntervention=Êtes-vous sûr de vouloir effacer cette intervention ? -ConfirmValidateIntervention=Êtes-vous sûr de vouloir valider cette intervention ? +ConfirmValidateIntervention=Êtes-vous sûr de vouloir valider cette intervention sous la référence %s ? ConfirmModifyIntervention=Êtes-vous sûr de vouloir modifier cette intervention ? ConfirmDeleteInterventionLine=Êtes-vous sûr de vouloir effacer cette ligne ? NameAndSignatureOfInternalContact=Nom et signature de l'intervenant : diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9bd1b09f85d..a8b2f307e70 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011 Philippe Grand * Copyright (C) 2008 Matteli - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -1566,7 +1566,13 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me //Dolibarr version $doliurl='http://www.dolibarr.org'; - print ''; + + $appli='Dolibarr'; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE; + + $appli.=" ".DOL_VERSION; + + print ''; print "\n"; print "\n";