mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
NEW Share msg "not found" for widgets and add a button to add new record when none exists (#31309)
* New msg displayed on widghet * update msg * comment code on box_fediverse * comment code on box_fediverse and delete code langs * fix errors * remove underscore before comparing files * update boxes for get messages and buttons * continue adding button for widgets --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
committed by
GitHub
parent
28cbda6a0b
commit
39e021feba
@@ -158,6 +158,14 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
||||
* @var string[] Example array("accounting")
|
||||
*/
|
||||
public $depends;
|
||||
/**
|
||||
* @var string urltoaddentry
|
||||
*/
|
||||
public $urltoaddentry;
|
||||
/**
|
||||
* @var string msg when no records exist
|
||||
*/
|
||||
public $msgNoRecords = 'NoRecordFound';
|
||||
|
||||
|
||||
|
||||
@@ -429,6 +437,17 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
||||
$out .= "</tr>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {
|
||||
$out .= '<tr><td colspan="2" class="center"><span class="opacitymedium">'.$langs->trans($this->msgNoRecords).' </span>';
|
||||
|
||||
// Check if $urltoaddentry is defined for the widget
|
||||
if (!empty($this->urltoaddentry)) {
|
||||
$out .= '<a href="'.$this->urltoaddentry.'">'.img_picto($langs->trans("New"), 'add', 'pictofixedwidth').'</a>';
|
||||
}
|
||||
|
||||
$out .= '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($head['text']) || !empty($head['sublink']) || !empty($head['subpicto']) || $nblines) {
|
||||
|
||||
Reference in New Issue
Block a user