From e4f7f2a0b2e7ac05d6917781eb8e0e14ffeee444 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Fri, 26 May 2017 12:39:49 +0200 Subject: [PATCH 01/13] $resaction need in 5.0.x too --- htdocs/core/class/hookmanager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 24ba86c7115..89a9b834482 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -233,7 +233,7 @@ class HookManager if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; //dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG); - $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) + $resaction = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; From 18799c3a7f1bddfbe7a2f3c27994e290a2de4d0e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Mon, 29 May 2017 11:00:08 +0200 Subject: [PATCH 02/13] Changes Done question need to change $actionclassinstance->results in $actionclassinstance->resactionss ??? --- htdocs/core/class/hookmanager.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 89a9b834482..0c78e89fa9e 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -238,10 +238,10 @@ class HookManager if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; // TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string. we must use $actionclassinstance->resprints to return a string - if (! is_array($result) && ! is_numeric($result)) + if (! is_array($resaction) && ! is_numeric($resaction)) { dol_syslog('Error: Bug into hook '.$method.' of module class '.get_class($actionclassinstance).'. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR); - if (empty($actionclassinstance->resprints)) { $this->resPrint.=$result; $result=0; } + if (empty($actionclassinstance->resprints)) { $this->resPrint.=$resaction; $resaction=0; } } } From 19b8918caf5ec68a00fe94af99d6bebeb3748570 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 13:35:51 +0200 Subject: [PATCH 03/13] FIX #6881 --- htdocs/install/upgrade2.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 09aa85d48c3..42c8f50632e 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -453,11 +453,11 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action'))) $db->close(); - // Actions for all version (not in database) + // Actions for all versions (not in database) migrate_delete_old_files($db, $langs, $conf); - migrate_delete_old_dir($db, $langs, $conf); + dol_mkdir(DOL_DATA_ROOT.'/bank'); migrate_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits'); } @@ -3926,7 +3926,11 @@ function migrate_delete_old_files($db,$langs,$conf) DOL_DOCUMENT_ROOT.'/core/modules/mailings/poire.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/mailings/kiwi.modules.php', DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_crabe.modules.php', - DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_oursin.modules.php' + DOL_DOCUMENT_ROOT.'/core/modules/facture/pdf_oursin.modules.php', + + DOL_DOCUMENT_ROOT.'/compta/facture/class/api_invoice.class.php', + DOL_DOCUMENT_ROOT.'/commande/class/api_commande.class.php', + DOL_DOCUMENT_ROOT.'/user/class/api_user.class.php' ); foreach ($filetodeletearray as $filetodelete) From d2813eabbcad08127c92d07534b7554b33c43d77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 13:39:07 +0200 Subject: [PATCH 04/13] FIX #6877 Conflicts: htdocs/install/mysql/migration/5.0.0-6.0.0.sql --- htdocs/install/mysql/migration/4.0.0-5.0.0.sql | 1 + htdocs/install/mysql/tables/llx_projet.sql | 1 + 2 files changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql index fa185f2864b..b5978efac99 100644 --- a/htdocs/install/mysql/migration/4.0.0-5.0.0.sql +++ b/htdocs/install/mysql/migration/4.0.0-5.0.0.sql @@ -45,6 +45,7 @@ ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_product (fk ALTER TABLE llx_facture_rec ADD COLUMN fk_user_modif integer; ALTER TABLE llx_expedition ADD COLUMN fk_user_modif integer; +ALTER TABLE llx_projet ADD COLUMN fk_user_modif integer; ALTER TABLE llx_adherent ADD COLUMN model_pdf varchar(255); diff --git a/htdocs/install/mysql/tables/llx_projet.sql b/htdocs/install/mysql/tables/llx_projet.sql index d50547b711b..8ca404d3a0e 100644 --- a/htdocs/install/mysql/tables/llx_projet.sql +++ b/htdocs/install/mysql/tables/llx_projet.sql @@ -30,6 +30,7 @@ create table llx_projet title varchar(255) NOT NULL, description text, fk_user_creat integer NOT NULL, -- createur du projet + fk_user_modif integer, public integer, -- project is public or not fk_statut integer DEFAULT 0 NOT NULL, -- open or close fk_opp_status integer DEFAULT NULL, -- if project is used to manage opportunities From 96b8339d21eab4bc275d365b9ba51c24108feda7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 26 May 2017 17:38:57 +0200 Subject: [PATCH 05/13] Fix: [Restler] Delete the cache file otherwise it does not update --- htdocs/api/admin/index.php | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 8142b564c1e..8ea22cee1d3 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -43,12 +43,29 @@ if ($action == 'setproductionmode') if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0) { - $result = dol_mkdir($conf->api->dir_temp); - if ($result < 0) - { - setEventMessages($langs->trans("ErrorFaildToCreateDir", $conf->api->dir_temp), null, 'errors'); - } - else + $error=0; + + if ($status == 1) + { + $result = dol_mkdir($conf->api->dir_temp); + if ($result < 0) + { + setEventMessages($langs->trans("ErrorFailedToCreateDir", $conf->api->dir_temp), null, 'errors'); + $error++; + } + } + else + { + // Delete the cache file otherwise it does not update + $result = dol_delete_file($conf->api->dir_temp.'/routes.php'); + if ($result < 0) + { + setEventMessages($langs->trans("ErrorFailedToDeleteFile", $conf->api->dir_temp.'/routes.php'), null, 'errors'); + $error++; + } + } + + if (!$error) { header("Location: ".$_SERVER["PHP_SELF"]); exit; From d8c5ec2aefb9d6e1abf4a313b287c0167a535e54 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 23 May 2017 18:27:41 +0200 Subject: [PATCH 06/13] FIX: REST API not possible to add agendaevents --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 5eeca63a4aa..b1014b9171a 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -289,7 +289,7 @@ class AgendaEvents extends DolibarrApi function _validate($data) { $event = array(); - foreach (Events::$FIELDS as $field) { + foreach (AgendaEvents::$FIELDS as $field) { if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $event[$field] = $data[$field]; From f21ec76bc040638768dcd572e388ac020d2274ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:16:37 +0200 Subject: [PATCH 07/13] Exclude dir --- build/makepack-dolibarr.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index c06d8f0730f..1dbd6f6fd5e 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -518,6 +518,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/forceproject*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`; From eea6461369088e27ab0208d7c3313865ed6e2cac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:27:22 +0200 Subject: [PATCH 08/13] Update ChangeLog for 4.0.6 --- ChangeLog | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5fe3c741499..e69b2a9d203 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,29 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 4.0.6 to 4.0.5 ***** +FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key +FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users +FIX: #6636 Complete fix +FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry +FIX: #6671 Cannot remove thirdparty type with "#" in its name +FIX: #6673 Missing "nature" table header in thirdparty list +FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list +FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty +FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode +FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it +FIX: #6813 +FIX: Correction with author and validator user on orders +FIX: doactions hook missing in invoice model page +FIX: dont get empty "Incoterms : - " string if no incoterm +FIX: dont lose supplier ref if no supplier price in database +FIX: forgotten parameter for right multicompany use +FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden +FIX: limit+1 dosn't show Total line +FIX: supplier order line were always created with rang = 0 +FIX: All known CVE at the date 31th of may. + + ***** ChangeLog for 4.0.5 to 4.0.4 ***** FIX: #6234 FIX: #6259 From 8edce66c08679e79634d7a22c510317aeb3c2d68 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 May 2017 21:27:22 +0200 Subject: [PATCH 09/13] Update ChangeLog for 4.0.6 --- ChangeLog | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5fe3c741499..e4c07380aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,28 @@ Upgrading to any other version or any other database system is abolutely require make a Dolibarr upgrade. +***** ChangeLog for 4.0.6 to 4.0.5 ***** +FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key +FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users +FIX: #6636 Complete fix +FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry +FIX: #6671 Cannot remove thirdparty type with "#" in its name +FIX: #6673 Missing "nature" table header in thirdparty list +FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list +FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty +FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode +FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it +FIX: #6813 +FIX: Correction with author and validator user on orders +FIX: doactions hook missing in invoice model page +FIX: dont get empty "Incoterms : - " string if no incoterm +FIX: dont lose supplier ref if no supplier price in database +FIX: forgotten parameter for right multicompany use +FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden +FIX: limit+1 dosn't show Total line +FIX: supplier order line were always created with rang = 0 + + ***** ChangeLog for 4.0.5 to 4.0.4 ***** FIX: #6234 FIX: #6259 From bd891ea56ab2de44ce7fc3f5ffe538d51ba7e9bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 May 2017 00:26:02 +0200 Subject: [PATCH 10/13] Deploy to server works even when cloudflare is active. --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 1dbd6f6fd5e..20dfc2579aa 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -19,7 +19,7 @@ use Cwd; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; -$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; +$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages From 5d115bcf6919d8796ef2abcd0e2291e5de0855ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 30 May 2017 20:58:32 +0200 Subject: [PATCH 11/13] Fix deadlock feature, can't process a leave request when validator has left company. --- htdocs/holiday/card.php | 60 +++++++++++++++++++++++++++++---- htdocs/langs/en_US/holiday.lang | 2 +- htdocs/langs/en_US/main.lang | 2 ++ 3 files changed, 57 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index c875caab271..78e2940942f 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -570,14 +570,43 @@ if ($action == 'confirm_refuse') } } + +// Si Validation de la demande +if ($action == 'confirm_draft' && GETPOST('confirm') == 'yes') +{ + $object = new Holiday($db); + $object->fetch($id); + + $oldstatus = $object->statut; + $object->statut = 1; + + $result = $object->update($user); + if ($result < 0) + { + $error = $langs->trans('ErrorBackToDraft'); + } + + if (! $error) + { + $db->commit(); + + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + exit; + } + else + { + $db->rollback(); + } +} + // Si Validation de la demande if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') { $object = new Holiday($db); $object->fetch($id); - // Si statut en attente de validation et valideur = utilisateur - if (($object->statut == 2 || $object->statut == 3) && ($user->id == $object->fk_validator || $user->id == $object->fk_user)) + // Si statut en attente de validation et valideur = valideur ou utilisateur, ou droits de faire pour les autres + if (($object->statut == 2 || $object->statut == 3) && ($user->id == $object->fk_validator || $user->id == $object->fk_user || ! empty($user->rights->holiday->write_all))) { $db->begin(); @@ -989,6 +1018,12 @@ else print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1); } + // Si back to draft + if ($action == 'backtodraft') + { + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleSetToDraft"),$langs->trans("ConfirmSetToDraft"),"confirm_draft", '', 1, 1); + } + $head=holiday_prepare_head($object); @@ -1208,18 +1243,31 @@ else print ''.$langs->trans("DeleteCP").''; } - if ($user->id == $object->fk_validator && $object->statut == 2) + if ($object->statut == 2) { - print ''.$langs->trans("Approve").''; - print ''.$langs->trans("ActionRefuseCP").''; + if ($user->id == $object->fk_validator) + { + print ''.$langs->trans("Approve").''; + print ''.$langs->trans("ActionRefuseCP").''; + } + else + { + print ''.$langs->trans("Approve").''; + print ''.$langs->trans("ActionRefuseCP").''; + } } - if (($user->id == $object->fk_validator || $user->id == $object->fk_user) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved + if (($user->id == $object->fk_validator || $user->id == $object->fk_user || ! empty($user->rights->holiday->write_all)) && ($object->statut == 2 || $object->statut == 3)) // Status validated or approved { if (($object->date_debut > dol_now()) || $user->admin) print ''.$langs->trans("ActionCancelCP").''; else print ''.$langs->trans("ActionCancelCP").''; } + if ($canedit && $object->statut == 4) + { + print ''.$langs->trans("SetToDraft").''; + } + print ''; } diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 441701c098d..e8d225d5af6 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -16,7 +16,7 @@ CancelCP=Canceled RefuseCP=Refused ValidatorCP=Approbator ListeCP=List of leaves -ReviewedByCP=Will be reviewed by +ReviewedByCP=Will be approved by DescCP=Description SendRequestCP=Create leave request DelayToRequestCP=Leave requests must be made at least %s day(s) before them. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ec4e218a11e..ba95ce233f8 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -757,6 +757,8 @@ SomeTranslationAreUncomplete=Some languages may be partially translated or may c DirectDownloadLink=Direct download link Download=Download ActualizeCurrency=Update currency rate +TitleSetToDraft=Go back to draft +ConfirmSetToDraft=Are you sure you want to go back to Draft status ? # Week day Monday=Monday Tuesday=Tuesday From b2779e2c08e176e639aab478c92e1a2a84016634 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 May 2017 12:05:53 +0200 Subject: [PATCH 12/13] Typo --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c297c5d8bce..57824562787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -215,7 +215,7 @@ Dolibarr better: - Method commande->set_availability(user, availability_id) removed from commande class, use method commande->availability(availability_id, notrigger). Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough -feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0. +feedback to confirm whole application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0. ***** ChangeLog for 4.0.6 to 4.0.5 ***** From e41541ab79150449ba1db6f52497beb7ac13db88 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 May 2017 12:47:21 +0200 Subject: [PATCH 13/13] Enhance detection of changelog not updated --- build/makepack-dolibarr.pl | 74 +++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 9c8f8ea601e..fdd14fcf5a2 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -14,7 +14,7 @@ #---------------------------------------------------------------------------- use Cwd; - +use Term::ANSIColor; # Change this to defined target for option 98 and 99 $PROJECT="dolibarr"; @@ -313,20 +313,6 @@ foreach my $target (sort keys %CHOOSEDTARGET) { print "\n"; -# Build xml check file -#----------------------- -if ($CHOOSEDTARGET{'-CHKSUM'}) -{ - print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; - $ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`; - print $ret."\n"; - # Copy to final dir - $NEWDESTI=$DESTI; - print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n"; - use File::Copy qw(copy); - copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"; -} - #print join(',',sort keys %CHOOSEDTARGET)."\n"; @@ -335,7 +321,10 @@ if ($CHOOSEDTARGET{'-CHKSUM'}) $nboftargetok=0; $nboftargetneedbuildroot=0; $nbofpublishneedtag=0; +$nbofpublishneedchangelog=0; + foreach my $target (sort keys %CHOOSEDTARGET) { + if ($target eq '-CHKSUM') { $nbofpublishneedchangelog++; } if ($CHOOSEDTARGET{$target} < 0) { next; } if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM') { @@ -345,34 +334,31 @@ foreach my $target (sort keys %CHOOSEDTARGET) { } foreach my $target (sort keys %CHOOSEDPUBLISH) { if ($CHOOSEDPUBLISH{$target} < 0) { next; } - if ($target eq 'ASSO') { $nbofpublishneedtag++; } - if ($target eq 'SF') { $nbofpublishneedtag++; } + if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } + if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; } $nboftargetok++; } + if ($nboftargetok) { - # Update GIT tag if required - #--------------------------- - if ($nbofpublishneedtag) + # Check Changelog + #---------------- + if ($nbofpublishneedchangelog) { - print "Go to directory $SOURCE\n"; - $olddir=getcwd(); - chdir("$SOURCE"); - # Test that the ChangeLog is ok $TMPBUILDTOCHECKCHANGELOG=$BUILD; $TMPBUILDTOCHECKCHANGELOG =~ s/\-rc\d*//; $TMPBUILDTOCHECKCHANGELOG =~ s/\-beta\d*//; - print "Check if ChangeLog is ok for version $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG\n"; + print "\nCheck if ChangeLog is ok for version $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG\n"; $ret=`grep "ChangeLog for $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG" "$SOURCE/ChangeLog" 2>&1`; if (! $ret) { - print "Error: The ChangeLogFile was not updated. Run the following command before building package for $MAJOR.$MINOR.$BUILD:\n"; + print color("yellow"), "Error: The ChangeLogFile was not updated. Run the following command before building package for $MAJOR.$MINOR.$BUILD:\n", color('reset'); } else { - print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with commande:'\n"; + print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with command:'\n"; } if (! $BUILD || $BUILD eq '0-rc') # For a major version { @@ -385,9 +371,39 @@ if ($nboftargetok) { print "\n"; if (! $ret) { - exit; + print "\nPress F to force and continue anyway (or other key to stop)... "; + my $WAITKEY=; + chomp($WAITKEY); + if ($WAITKEY ne 'F') + { + print "Canceled.\n"; + exit; + } } - + } + + # Build xml check file + #----------------------- + if ($CHOOSEDTARGET{'-CHKSUM'}) + { + print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; + $ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`; + print $ret."\n"; + # Copy to final dir + $NEWDESTI=$DESTI; + print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n"; + use File::Copy qw(copy); + copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"; + } + + # Update GIT tag if required + #--------------------------- + if ($nbofpublishneedtag) + { + print "Go to directory $SOURCE\n"; + $olddir=getcwd(); + chdir("$SOURCE"); + print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n"; $ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`; if ($ret =~ /(already exists|existe déjà)/)