Skip to content

Commit

Permalink
Evarisk#574 [ODT] fix: new exception OdfExceptionSegmentNotFound and …
Browse files Browse the repository at this point in the history
…remove version attribute and phpmin
  • Loading branch information
nicolas-eoxia committed Mar 22, 2024
1 parent 5873060 commit 95a0430
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@
*/
class doc_certificatedocument_odt extends SaturneDocumentModel
{
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.5 = array(5, 5)
*/
public $phpmin = [7, 4];

/**
* @var string Dolibarr version of the loaded document.
*/
public string $version = 'dolibarr';

/**
* @var string Module.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@
*/
class doc_projectdocument_odt extends SaturneDocumentModel
{
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.5 = array(5, 5)
*/
public $phpmin = [7, 4];

/**
* @var string Dolibarr version of the loaded document.
*/
public string $version = 'dolibarr';

/**
* @var string Module.
*/
Expand Down Expand Up @@ -126,7 +115,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('projectUsers');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand Down Expand Up @@ -172,7 +161,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('projectTasks');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand Down Expand Up @@ -204,7 +193,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('projectTaskTimespents');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand Down Expand Up @@ -250,7 +239,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('projectExtrafields');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@
*/
class doc_timesheetdocument_odt extends SaturneDocumentModel
{
/**
* @var array Minimum version of PHP required by module.
* e.g.: PHP ≥ 5.5 = array(5, 5)
*/
public $phpmin = [7, 4];

/**
* @var string Dolibarr version of the loaded document.
*/
public string $version = 'dolibarr';

/**
* @var string Module.
*/
Expand Down Expand Up @@ -137,7 +126,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('days');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand All @@ -163,7 +152,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('times');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
$listLines = '';
Expand Down Expand Up @@ -218,7 +207,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment($segment[0][$i]);
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand Down Expand Up @@ -246,7 +235,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('totalrhs');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand All @@ -270,7 +259,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('totaltimes');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand All @@ -295,7 +284,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('totaltpss');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand All @@ -321,7 +310,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('tas');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand All @@ -347,7 +336,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('diffs');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand All @@ -372,7 +361,7 @@ public function fillTagsLines(Odf $odfHandler, Translate $outputLangs, array $mo
$foundTagForLines = 1;
try {
$listLines = $odfHandler->setSegment('timesheetdet');
} catch (OdfException $e) {
} catch (OdfException|OdfExceptionSegmentNotFound $e) {
// We may arrive here if tags for lines not present into template.
$foundTagForLines = 0;
dol_syslog($e->getMessage());
Expand Down
1 change: 1 addition & 0 deletions view/workinghours_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
print '</table>';

// Buid current user hierarchy
$usertmphierarchy = [];
if ($usertmp->fk_user > 0) {
$usertmphierarchy = array($usertmp->fk_user);
$usertmpboss = new User($object->db);
Expand Down

0 comments on commit 95a0430

Please sign in to comment.