diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8640c5e9b2fb92c66b23cdc9cf2d4e0850e2979b..a39f6b84a59b39453a774d63c8279fa71321658e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,7 @@ When submitting a pull request, use same rule as [Commits](#commits) for the mes If your pull request only contains one commit, GitHub will be smart enough to fill it for you. Otherwise, please be a bit verbose about what you're providing. -You Pull Request must pass the Continuous Integration checks. +Your Pull Request must pass the Continuous Integration checks. Also, if you want to include a new external library (into htdocs/includes directory), please ask before to the project leader to see if such a library can be accepted. diff --git a/dev/skeletons/skeleton_card.php b/dev/skeletons/skeleton_card.php index a85969c53ad9301543ec6e8ae6ad67465ab0e97a..7f0ff1fc7d4ad3bbf92cc332f927075c94d21f55 100644 --- a/dev/skeletons/skeleton_card.php +++ b/dev/skeletons/skeleton_card.php @@ -112,7 +112,7 @@ if (empty($reshook)) if (empty($object->ref)) { $error++; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors'); + setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors'); } if (! $error) @@ -152,7 +152,7 @@ if (empty($reshook)) if (empty($object->ref)) { $error++; - setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors'); + setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors'); } if (! $error) @@ -189,8 +189,8 @@ if (empty($reshook)) } else { - if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors'); - else setEventMessages($object->error,null,'errors'); + if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); } } } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index bc18d379a8790183e924f908e73b9149ea6b609e..f2fcd49027750619350b810b72735d9827472fcb 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -71,7 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -89,7 +89,7 @@ else if ($action == 'classifyrefunded' && $user->rights->deplacement->creer) } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } @@ -104,7 +104,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -150,7 +150,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer) } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action='create'; } } @@ -190,7 +190,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer) } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else @@ -411,8 +411,8 @@ else if ($id) } else { - /* - * Confirmation de la suppression du deplacement + /* + * Confirm delete trip */ if ($action == 'delete') { diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 8fe20cd66f6d7b8f1e57639d64c02659c57b4e33..b07a8f8c2d46b2a68f644b137f44344a49e195fa 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net> * Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com> + * Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com> * * 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 @@ -48,7 +48,7 @@ $object = new Facture($db); /* - * Ajout d'un nouveau contact + * Add a new contact */ if ($action == 'addcontact' && $user->rights->facture->creer) @@ -71,16 +71,16 @@ if ($action == 'addcontact' && $user->rights->facture->creer) if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); + setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } } -// Bascule du statut d'un contact +// Toggle the status of a contact else if ($action == 'swapstatut' && $user->rights->facture->creer) { if ($object->fetch($id)) @@ -93,7 +93,7 @@ else if ($action == 'swapstatut' && $user->rights->facture->creer) } } -// Efface un contact +// Deletes a contact else if ($action == 'deletecontact' && $user->rights->facture->creer) { $object->fetch($id); @@ -124,7 +124,7 @@ $userstatic=new User($db); /* *************************************************************************** */ /* */ -/* Mode vue et edition */ +/* View and edit mode */ /* */ /* *************************************************************************** */ @@ -139,7 +139,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'contact', $langs->trans('InvoiceCustomer'), 0, 'bill'); /* - * Facture synthese pour rappel + * Summary invoice for reminder */ print '<table class="border" width="100%">'; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index f01c288e29edfc49712b4324fdef0a51aad3bca2..3f7aec9809fdffc5e92b3264c48a66bcb692161b 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -70,7 +70,7 @@ if ($action == 'add') { if (! GETPOST('titre')) { - setEventMessage($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->trans("Title")), null, 'errors'); $action = "create"; $error++; } @@ -88,13 +88,13 @@ if ($action == 'add') } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; } } } -// Suppression +// Delete if ($action == 'delete' && $user->rights->facture->supprimer) { $object->fetch($id); diff --git a/htdocs/compta/facture/mergepdftool.php b/htdocs/compta/facture/mergepdftool.php index 1b14a019170756b0a00ca24fa42a5edd68738c8c..968ab8543c2ea3a2cb683851f3d58ecf9e49bcdf 100644 --- a/htdocs/compta/facture/mergepdftool.php +++ b/htdocs/compta/facture/mergepdftool.php @@ -107,14 +107,14 @@ if ($action == 'presend' && GETPOST('sendmail')) if (!isset($user->email)) { $error++; - setEventMessage("NoSenderEmailDefined"); + setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); } $countToSend = count($_POST['toSend']); if (empty($countToSend)) { $error++; - setEventMessage("InvoiceNotChecked","warnings"); + setEventMessages($langs->trans("InvoiceNotChecked"), null, 'warnings'); } if (! $error) @@ -260,11 +260,11 @@ if ($action == 'presend' && GETPOST('sendmail')) if ($nbsent) { $action=''; // Do not show form post if there was at least one successfull sent - setEventMessage($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent")); + setEventMessages($nbsent. '/'.$countToSend.' '.$langs->trans("RemindSent"), null, 'mesgs'); } else { - setEventMessage($langs->trans("NoRemindSent"), 'warnings'); // May be object has no generated PDF file + setEventMessages($langs->trans("NoRemindSent"), null, 'warnings'); // May be object has no generated PDF file } } } @@ -349,16 +349,16 @@ if ($action == "builddoc" && $user->rights->facture->lire && ! GETPOST('button_s @chmod($file, octdec($conf->global->MAIN_UMASK)); $langs->load("exports"); - setEventMessage($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog'))); + setEventMessages($langs->trans('FileSuccessfullyBuilt',$filename.'_'.dol_print_date($now,'dayhourlog')), null, 'mesgs'); } else { - setEventMessage($langs->trans('NoPDFAvailableForChecked'),'errors'); + setEventMessages($langs->trans('NoPDFAvailableForChecked'), null, 'errors'); } } else { - setEventMessage($langs->trans('InvoiceNotChecked'), 'warnings'); + setEventMessages($langs->trans('InvoiceNotChecked'), null, 'warnings'); } } @@ -371,8 +371,8 @@ if ($action == 'remove_file') $upload_dir = $diroutputpdf; $file = $upload_dir . '/' . GETPOST('file'); $ret=dol_delete_file($file); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); $action=''; } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 78a93d7da0d655ed035f9749155f776c7c24a9a8..47abb50fb8bba0bc2c19241cc45882c8987634e7 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -75,12 +75,12 @@ if ($action == "new") { $db->commit(); - setEventMessage($langs->trans("RecordSaved")); + setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } else { $db->rollback(); - setEventMessage($object->error, $object->errors, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } $action=''; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 51a899c074828b4fcfbf350f680f3518946874a4..ba65669aca449d5e07360e4ba73936b792f8d5dd 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -3,8 +3,8 @@ * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> - * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com> - * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2013 Marcos García <marcosgdf@gmail.com> + * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es> * * 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 @@ -66,7 +66,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement) } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } @@ -86,7 +86,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> else { $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } @@ -124,7 +124,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture-> else { $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } } @@ -135,11 +135,11 @@ if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement'])) $res = $object->update_num($_POST['num_paiement']); if ($res === 0) { - setEventMessage($langs->trans('PaymentNumberUpdateSucceeded')); + setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs'); } else { - setEventMessage($langs->trans('PaymentNumberUpdateFailed'), 'errors'); + setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors'); } } @@ -150,11 +150,11 @@ if ($action == 'setdatep' && ! empty($_POST['datepday'])) $res = $object->update_date($datepaye); if ($res === 0) { - setEventMessage($langs->trans('PaymentDateUpdateSucceeded')); + setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); } else { - setEventMessage($langs->trans('PaymentDateUpdateFailed'), 'errors'); + setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors'); } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 803787589fe73f35ec08a309cfb3d4f17699610b..163f242b76d8d5f9e097e43ec373a2fd93330a18 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -79,12 +79,12 @@ if ($action == 'setdate' && $user->rights->banque->cheque) $result=$object->set_date($user,$date); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -98,12 +98,12 @@ if ($action == 'setrefext' && $user->rights->banque->cheque) $result=$object->setValueFrom('ref_ext', $ref_ext); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -117,12 +117,12 @@ if ($action == 'setref' && $user->rights->banque->cheque) $result=$object->set_number($user,$number); if ($result < 0) { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -154,12 +154,12 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } else { - setEventMessage($langs->trans("ErrorSelectAtLeastOne")); + setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs'); $action='new'; } } @@ -175,7 +175,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -190,7 +190,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c } else { - setEventMessage($paiement->error, 'errors'); + setEventMessages($paiement->error, $paiement->errors, 'errors'); } } @@ -217,7 +217,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c } else { - setEventMessage($object->error, 'errors'); + setEventMessages($object->error, $object->errors, 'errors'); } } @@ -230,7 +230,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban $paiement_id = $object->rejectCheck($rejected_check, $reject_date); if ($paiement_id > 0) { - setEventMessage($langs->trans("CheckRejectedAndInvoicesReopened")); + setEventMessages($langs->trans("CheckRejectedAndInvoicesReopened"), null, 'mesgs'); //header("Location: ".DOL_URL_ROOT.'/compta/paiement/card.php?id='.$paiement_id); //exit; $action=''; @@ -282,8 +282,8 @@ else if ($action == 'remove_file' && $user->rights->banque->cheque) $file=$dir.get_exdir($object->number,0,1,0,$object,'cheque') . GETPOST('file'); $ret=dol_delete_file($file,0,0,0,$object); - if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('file'))); - else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), 'errors'); + if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); + else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors'); } } diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index 0bc54416fd16a316d4596760ff3cba0b0a8e7602..52750352afa81f7ffd9e1511a7b3533ead4e1cb9 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -284,7 +284,7 @@ IMG; private function _parse($type='content') { // Search all tags fou into condition to complete $this->vars, so we will proceed all tests even if not defined - $reg='@\[!--\sIF\s([{}a-zA-Z_]+)\s--\]@smU'; + $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU'; preg_match_all($reg, $this->contentXml, $matches, PREG_SET_ORDER); //var_dump($this->vars);exit; foreach($matches as $match) // For each match, if there is no entry into this->vars, we add it