//added Preactivation request on dashboard
This commit is contained in:
1 parent
79b7521cac
commit
0020412aea
2 files changed
+35
No files matched your search
@@ -356,6 +356,18 @@ class AdminDashboardControllerCore extends AdminController
|
|||||||
|
|
||||||
die(Tools::jsonEncode($return));
|
die(Tools::jsonEncode($return));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ajaxProcessSavePreactivationRequest()
|
||||||
|
{
|
||||||
|
$isoUser = Context::getContext()->language->iso_code;
|
||||||
|
$isoCountry = Context::getContext()->country->iso_code;
|
||||||
|
$employee = new Employee((int)Context::getContext()->cookie->id_employee);
|
||||||
|
$firstname = $employee->firstname;
|
||||||
|
$lastname = $employee->lastname;
|
||||||
|
$email = $employee->email;
|
||||||
|
$return = @Tools::file_get_contents('http://api.prestashop.com/partner/premium/set_request.php?iso_country='.strtoupper($isoCountry).'&iso_lang='.strtolower($isoUser).'&host='.urlencode($_SERVER['HTTP_HOST']).'&ps_version='._PS_VERSION_.'&ps_creation='._PS_CREATION_DATE_.'&partner='.htmlentities(Tools::getValue('module')).'&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&email='.urlencode($email).'&firstname='.urlencode($firstname).'&lastname='.urlencode($lastname).'&type=home');
|
||||||
|
die($return);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -28,6 +28,10 @@ $(document).ready( function () {
|
|||||||
setDashboardDateRange(elt.currentTarget.name);
|
setDashboardDateRange(elt.currentTarget.name);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
$(".preactivationLink").click(function() {
|
||||||
|
preactivationLinkClick($(this).attr("rel"));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
refreshDashboard(false, false);
|
refreshDashboard(false, false);
|
||||||
getBlogRss();
|
getBlogRss();
|
||||||
@@ -283,3 +287,22 @@ function saveDashConfig(widget_name)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function preactivationLinkClick(module)
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
url : adminstats_ajax_url,
|
||||||
|
data : {
|
||||||
|
ajax : "1",
|
||||||
|
controller : "AdminDashboard",
|
||||||
|
action : "savePreactivationRequest",
|
||||||
|
module : module,
|
||||||
|
},
|
||||||
|
type: 'POST',
|
||||||
|
success : function(jsonData){
|
||||||
|
|
||||||
|
},
|
||||||
|
error : function(data){
|
||||||
|
//@TODO display errors
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in new issue
Block a user