Hmmm cant seem to get this to work.
I outputed all the jazz and got the values of
dashlets, array, 0,, home
so I outputed the array to a file and wrote this
PHP Code:
<?php
require_once('modules/Users/User.php');
global $db;
$results = $db->query("SELECT id FROM users WHERE deleted = 0 and last_name = 'Robertson'");
while($row = $db->fetchByAssoc($results))
{
$focus = new User();
$focus->retrieve($row['id']);
$dashletVal = getDashletVal();
print_r($dashletVal);
$focus->setPreference('dashlets', $dashletVal,false,'home',$focus);
$focus->savePreferecesToDB();
}
function getDashletVal()
{
$file = "/var/www/html/crm/initialSetting/pipeline_pref.txt";
$fp = fopen($file, "r");
$content = fread($fp, filesize($file));
$val = unserialize($content);
// print_r($val);
return $val;
}
?>
as far as I Can tell its pumping in the same items but its not updating the pregs.... grrrr
Bookmarks