Widget : javascript variable uniq
This commit is contained in:
parent
5a7a2c9b11
commit
9d1f7bf29d
3 changed files with 14 additions and 4 deletions
|
|
@ -11,3 +11,6 @@ echo \HtmlInput::button_action(_('Elements du tableau de bord'), "widget.manage(
|
|||
|
||||
|
||||
?>
|
||||
<script>
|
||||
var widget=new Widget('<?=\Dossier::id()?>')
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,10 @@ if ( $action == 'widget.save') {
|
|||
$query=$http->request("param","string","");
|
||||
try {
|
||||
parse_str($query, $aWigdet);
|
||||
\Noalyss\Widget\Widget::save($aWigdet['contain_widget']);
|
||||
if (isset ($aWigdet['contain_widget']))
|
||||
\Noalyss\Widget\Widget::save($aWigdet['contain_widget']);
|
||||
else
|
||||
\Noalyss\Widget\Widget::save(array());
|
||||
|
||||
} catch (\Exception $e) {
|
||||
echo "NOK";
|
||||
|
|
|
|||
|
|
@ -180,10 +180,11 @@ where use_login=$1 order by uw.uw_order
|
|||
$widget->close_div();
|
||||
|
||||
$dossier_id=\Dossier::id();
|
||||
$widgetjs=uniqid('widget');
|
||||
echo <<<EOF
|
||||
<script>
|
||||
var widget= new Widget('{$dossier_id}')
|
||||
widget.display('{$box}',{$widget->get_user_widget_id()},'{$widget->get_widget_code()}')
|
||||
var {$widgetjs}= new Widget('{$dossier_id}')
|
||||
{$widgetjs}.display('{$box}',{$widget->get_user_widget_id()},'{$widget->get_widget_code()}')
|
||||
</script>
|
||||
|
||||
|
||||
|
|
@ -218,8 +219,11 @@ EOF;
|
|||
* @exception DatabaseCore fails , cannot update
|
||||
*/
|
||||
static function save($array) {
|
||||
if (empty($array)) return;
|
||||
global $cn,$g_user;
|
||||
if (empty($array)) {
|
||||
$cn->exec_sql("delete from user_widget where use_login = $1",[$g_user->getLogin()]);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
$cn->start();
|
||||
$order=10;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue