Skip to content

Commit

Permalink
Merge pull request Dolibarr#6 from atm-GregM/FIX_update_class_card_li…
Browse files Browse the repository at this point in the history
…st_langs

Fix update class card list langs
  • Loading branch information
John BOTELLA authored Jul 22, 2022
2 parents 088dae1 + 025baa6 commit c7115fc
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 52 deletions.
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.

## Version 0.1 [2020-12-25]

- FIX : Suppression des champs qté réalisée et quantité prévue à la création d'un sprint *21/07/2022* - 1.0.9
- FIX : Update visuel de la liste US planifiée *21/07/2022* - 1.0.8
- FIX : SQL : Renvoi la liste de Tâches scrum de la fiche US planifiée concernée *21/07/2022* - 1.0.7
- FIX : Fiche create et modify US planifiée et Tache Scrum : Suppression champ statut *21/07/2022* - 1.0.6
- FIX : Formulaire U.S. et U.S. Planifiée type html champ description *21/07/2022* - 1.0.5
- FIX : Modification langs Qty consommée *21/07/2022* - 1.0.4
- FIX : scrumuserstorysprint status BTN *03/05/2022* - 1.0.3
- FIX : sql query for scrum quntity summary *03/05/2022* - 1.0.2
- FIX : elements names *03/05/2022* - 1.0.1
Expand Down
4 changes: 2 additions & 2 deletions class/scrumsprint.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class ScrumSprint extends CommonObject
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
'qty_velocity' => array('type'=>'real', 'label'=>'QtyVelocity', 'enabled'=>'1', 'position'=>100, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_planned' => array('type'=>'real', 'label'=>'QtyPlanned', 'enabled'=>'1', 'position'=>105, 'notnull'=>0, 'visible'=>1, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_done' => array('type'=>'real', 'label'=>'QtyDone', 'enabled'=>'1', 'position'=>110, 'notnull'=>0, 'visible'=>1, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_planned' => array('type'=>'real', 'label'=>'QtyPlanned', 'enabled'=>'1', 'position'=>105, 'notnull'=>0, 'visible'=>4, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_done' => array('type'=>'real', 'label'=>'QtyDone', 'enabled'=>'1', 'position'=>110, 'notnull'=>0, 'visible'=>4, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_consumed' => array('type'=>'real', 'label'=>'QtyConsumed', 'enabled'=>'1', 'position'=>120, 'notnull'=>0, 'visible'=>5, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
Expand Down
2 changes: 1 addition & 1 deletion class/scrumtask.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ScrumTask extends CommonObject
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'), 'validate'=>'1',),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', '1'=>'Validé', '9'=>'Annulé'), 'validate'=>'1', 'default' => 0),
);
public $rowid;
public $ref;
Expand Down
4 changes: 2 additions & 2 deletions class/scrumuserstory.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ class ScrumUserStory extends CommonObject
'business_value' => array('type'=>'integer', 'label'=>'BusinessValue', 'enabled'=>'1', 'position'=>52, 'showoncombobox'=>'0', 'notnull'=>1, 'visible'=>-1, 'default'=>'50', 'index'=>1, 'validate'=>'1',),
'point' => array('type'=>'real', 'label'=>'Points', 'enabled'=>'1', 'position'=>45, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp', 'help'=>"Help text for quantity", 'validate'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>"Help text", 'showoncombobox'=>'2', 'validate'=>'1',),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', 1=>'Validé', 2 => 'Plannifié', 9=>'Annulé'), 'validate'=>'1', 'default' => 0),
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Brouillon', 1=>'Validé', 2 => 'Plannifié', 9=>'Annulé'), 'validate'=>'1', 'default' => 0),
);
public $rowid;
public $fk_task;
Expand Down
2 changes: 1 addition & 1 deletion class/scrumuserstorysprint.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ScrumUserStorySprint extends CommonObject
'qty_planned' => array('type'=>'real', 'label'=>'QtyPlanned', 'enabled'=>'1', 'position'=>100, 'notnull'=>1, 'visible'=>1, 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_consumed' => array('type'=>'real', 'label'=>'QtyConsumed', 'enabled'=>'1', 'position'=>105, 'notnull'=>0, 'visible'=>4, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'qty_done' => array('type'=>'real', 'label'=>'QtyDone', 'enabled'=>'1', 'position'=>110, 'notnull'=>0, 'visible'=>4, 'noteditable'=>'1', 'default'=>'0', 'isameasure'=>'1', 'css'=>'maxwidth75imp',),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>120, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
'description' => array('type'=>'html', 'label'=>'Description', 'enabled'=>'1', 'position'=>120, 'notnull'=>0, 'visible'=>3, 'validate'=>'1',),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>130, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>140, 'notnull'=>0, 'visible'=>0, 'validate'=>'1',),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
Expand Down
2 changes: 1 addition & 1 deletion core/modules/modScrumProject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function __construct($db)
$this->editor_name = 'ATM Consulting';
$this->editor_url = 'www.atm-consulting.fr';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = '1.0.3';
$this->version = '1.0.9';
// Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';

Expand Down
10 changes: 6 additions & 4 deletions core/modules/scrumproject/mod_scrumsprint_standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public function info()
*/
public function getExample()
{
return $this->prefix."0501-0001";
global $db;
include_once __DIR__.'/../../../class/scrumsprint.class.php';
$object = new ScrumSprint($db);
return $this->getNextValue($object);
}


Expand All @@ -89,7 +92,6 @@ public function canBeActivated($object)
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."scrumproject_scrumsprint";
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
$sql .= " AND fk_team = ".$object->fk_team;
if ($object->ismultientitymanaged == 1) {
$sql .= " AND entity = ".$conf->entity;
} elseif ($object->ismultientitymanaged == 2) {
Expand Down Expand Up @@ -126,15 +128,15 @@ public function getNextValue($object)
$posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max";
$sql .= " FROM ".MAIN_DB_PREFIX."scrumproject_scrumsprint";
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
$sql .= " AND fk_team = ".$object->fk_team;
$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);

if ($resql)
{
$obj = $db->fetch_object($resql);
Expand Down
2 changes: 1 addition & 1 deletion langs/fr_FR/scrumproject.lang
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ StatusScrumUserStorySprintDraft = Brouillon
StatusScrumUserStorySprintReady = Prête
StatusScrumUserStorySprintDone = Terminée
BusinessValue = Business value
QtyConsumed = Qty consommée
QtyConsumed = Qté consommée

ScrumUserStorySprints = user story planifiée
ListOfScrumUserStorys = Liste des user stories
Expand Down
2 changes: 1 addition & 1 deletion scrumsprint_card.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ function init_myfunc()

if (empty($reshook))
{
if($object->status == $object::STATUS_DRAFT) {
if($object->status != $object::STATUS_DRAFT) {
print dolGetButtonAction($langs->trans('RefreshVelocity'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=refreshVelocity');
}

Expand Down
19 changes: 11 additions & 8 deletions scrumtask_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@
/*
* View
*/

$form = new Form($db);

$now = dol_now();
Expand Down Expand Up @@ -288,8 +287,9 @@
} else {
$sql .= " WHERE 1 = 1";
}


if (!empty($fk_scrum_user_story_sprint)){
$sql .= ' AND fk_scrum_user_story_sprint = '.$fk_scrum_user_story_sprint;
}

foreach ($search as $key => $val) {
if (array_key_exists($key, $object->fields)) {
Expand Down Expand Up @@ -370,14 +370,14 @@
}*/
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^SELECT[a-z0-9\._\s\(\),]+FROM/i', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$resql = $db->query($sqlforcount);
$objforcount = $db->fetch_object($resql);
$nbtotalofrecords = $objforcount->nbtotalofrecords;

$objforcount = $db->getRow($sqlforcount);
$nbtotalofrecords = !empty($objforcount)?$objforcount->nbtotalofrecords:0;

if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
$page = 0;
$offset = 0;
}
$db->free($resql);
}

// Complete request and execute it with limit
Expand Down Expand Up @@ -516,10 +516,13 @@
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';


$newScrumTaskUrl = dol_buildpath('/scrumproject/scrumtask_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']);
$newScrumTaskUrl = dol_buildpath('/scrumproject/scrumtask_card.php', 1).'?action=create';
$backtopageAdd = $_SERVER['PHP_SELF'];
if($fk_scrum_user_story_sprint>0){
$newScrumTaskUrl.= '&fk_scrum_user_story_sprint='.$fk_scrum_user_story_sprint;
$backtopageAdd.= '?fk_scrum_user_story_sprint='.$fk_scrum_user_story_sprint;
}
$newScrumTaskUrl.= '&backtopage='.urlencode($backtopageAdd);

$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $newScrumTaskUrl, '', $permissiontoadd);

Expand Down
63 changes: 32 additions & 31 deletions scrumuserstorysprint_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -735,13 +735,6 @@
// --------------------------------------------------------------------
print '<tr class="liste_titre">';

if (!empty($arrayfields['societe']['checked'])) {
print getTitleFieldOfList($arrayfields['societe']['label'], 0, $_SERVER['PHP_SELF'], 'societe', '', $param, '', $sortfield, $sortorder)."\n";
}

if (!empty($arrayfields['project_title']['checked'])) {
print getTitleFieldOfList($arrayfields['project_title']['label'], 0, $_SERVER['PHP_SELF'], 'project_title', '', $param, '', $sortfield, $sortorder)."\n";
}

foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
Expand All @@ -757,6 +750,15 @@
if (!empty($arrayfields['t.'.$key]['checked'])) {
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
}
if ($key == "fk_scrum_sprint"){
if (!empty($arrayfields['societe']['checked'])) {
print getTitleFieldOfList($arrayfields['societe']['label'], 0, $_SERVER['PHP_SELF'], 'societe', '', $param, '', $sortfield, $sortorder)."\n";
}

if (!empty($arrayfields['project_title']['checked'])) {
print getTitleFieldOfList($arrayfields['project_title']['label'], 0, $_SERVER['PHP_SELF'], 'project_title', '', $param, '', $sortfield, $sortorder)."\n";
}
}
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
Expand Down Expand Up @@ -797,30 +799,6 @@
// Show here line of result
print '<tr class="oddeven">';


if (!empty($arrayfields['societe']['checked'])) {
print '<td class="liste_titre">';
$societe = scrumProjectGetObjectByElement('societe', $obj->fk_soc);
if($societe){
/** @var Societe $societe */
print $societe->getNomUrl(1);
}
print '</td>';
$totalarray['nbfield']++;
}

if (!empty($arrayfields['project_title']['checked'])) {
print '<td class="liste_titre">';
$project = scrumProjectGetObjectByElement('project', $obj->fk_project);
if($project){
/** @var Project $project */
print $project->getNomUrl(1, '', 1);
}
print '</td>';
$totalarray['nbfield']++;
}


foreach ($object->fields as $key => $val) {
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
Expand Down Expand Up @@ -873,6 +851,29 @@
$totalarray['val']['t.'.$key] += $object->$key;
}
}
if ($key == 'fk_scrum_sprint'){
if (!empty($arrayfields['societe']['checked'])) {
print '<td >';
$societe = scrumProjectGetObjectByElement('societe', $obj->fk_soc);
if($societe){
/** @var Societe $societe */
print $societe->getNomUrl(1);
}
print '</td>';
$totalarray['nbfield']++;
}

if (!empty($arrayfields['project_title']['checked'])) {
print '<td >';
$project = scrumProjectGetObjectByElement('project', $obj->fk_project);
if($project){
/** @var Project $project */
print $project->getNomUrl(1, '', 1);
}
print '</td>';
$totalarray['nbfield']++;
}
}
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
Expand Down

0 comments on commit c7115fc

Please sign in to comment.