Skip to content

Commit

Permalink
#30 [Mod] fix: clean mod class files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Nov 3, 2022
1 parent 290db95 commit d04faef
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@
class mod_certificate_standard extends ModeleNumRefDoliSIRH
{
/**
* Dolibarr version of the loaded document
* Dolibarr version of the loaded numbering module ref
* @var string
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'

/**
* @var string numbering module ref prefix
*/
public $prefix = 'CERT';

/**
Expand Down Expand Up @@ -87,8 +90,6 @@ public function canBeActivated(object $object): bool
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down Expand Up @@ -125,8 +126,6 @@ public function getNextValue(object $object)
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class mod_certificatedocument_standard
public $name = 'Skrymir';

/**
* Return description of numbering module
* Return description of document
*
* @return string Text with description
*/
Expand All @@ -71,7 +71,7 @@ public function isEnabled(): bool
}

/**
* Return an example of numbering
* Return an example of document
*
* @return string Example
*/
Expand All @@ -82,7 +82,7 @@ public function getExample(): string

/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
* cause conflicts that would prevent this document working.
*
* @param Object $object Object we need next value for
* @return boolean false if are conflict, true if ok
Expand Down Expand Up @@ -169,7 +169,7 @@ public function getNextValue(object $object)
}

/**
* Returns version of numbering module
* Returns version of document
*
* @return string Value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* \brief File that contains parent class for certificates document models
*/

require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/commondocgenerator.class.php';

/**
* Parent class for documents models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class mod_timesheetdocument_standard
public $name = 'Égéon';

/**
* Return description of numbering module
* Return description of document
*
* @return string Text with description
*/
Expand All @@ -71,7 +71,7 @@ public function isEnabled(): bool
}

/**
* Return an example of numbering
* Return an example of document
*
* @return string Example
*/
Expand All @@ -82,7 +82,7 @@ public function getExample(): string

/**
* Checks if the numbers already in the database do not
* cause conflicts that would prevent this numbering working.
* cause conflicts that would prevent this document working.
*
* @param Object $object Object we need next value for
* @return boolean false if are conflict, true if ok
Expand All @@ -99,8 +99,6 @@ public function canBeActivated(object $object): bool
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down Expand Up @@ -137,8 +135,6 @@ public function getNextValue(object $object)
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down Expand Up @@ -169,7 +165,7 @@ public function getNextValue(object $object)
}

/**
* Returns version of numbering module
* Returns version of document
*
* @return string Value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* \brief File that contains parent class for timesheet document models and parent class for timesheet numbering models
*/

require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/commondocgenerator.class.php';

/**
* Parent class for documents models
Expand Down
8 changes: 2 additions & 6 deletions core/modules/dolisirh/timesheet/mod_timesheet_standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
class mod_timesheet_standard extends ModeleNumRefDoliSIRH
{
/**
* Dolibarr version of the loaded document
* Dolibarr version of the loaded numbering module ref
* @var string
*/
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'

/**
* @var string document prefix
* @var string numbering module ref prefix
*/
public $prefix = 'TR';

Expand Down Expand Up @@ -91,8 +91,6 @@ public function canBeActivated(object $object): bool
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down Expand Up @@ -129,8 +127,6 @@ public function getNextValue(object $object)
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
// TODO
}

$resql = $db->query($sql);
Expand Down
8 changes: 4 additions & 4 deletions dolisirhindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@
// Load translation files required by the page
$langs->loadLangs(array("dolisirh@dolisirh"));

// Parameters
// Get parameters
$action = GETPOST('action', 'alpha');

// Initialize technical objects
$dolisirh = new modDoliSIRH($db);

// Security check
if (! $user->rights->dolisirh->lire) accessforbidden();
if (!$user->rights->dolisirh->lire) accessforbidden();

/*
* Actions
*/
* Actions
*/

require_once './core/tpl/dolisirh_projectcreation_action.tpl.php';

Expand Down

0 comments on commit d04faef

Please sign in to comment.