Пример #1
0
 $profile = new MM_CommissionProfile($item->id);
 // Default Flag
 $defaultDescription = "Any commission profile can be marked as the default commission profile. The default commission profile is used when a customer purchases any product in MemberMouse. The default profile can be overridden by editing a product, going to the Commissions section and selecting another commission profile from the drop down.";
 if ($profile->isDefault()) {
     $defaultFlag = MM_Utils::getDefaultFlag("Default Commission Profile\n\n{$defaultDescription}", "", true, 'margin-right:5px;');
 } else {
     $defaultFlag = MM_Utils::getDefaultFlag("Set as Default Commission Profile\n\n{$defaultDescription}", "onclick='mmjs.setDefault(\"" . $item->id . "\")'", false, 'margin-right:5px;');
 }
 if ($profile->initialCommissionEnabled()) {
     $initialCommission = MM_Utils::getCheckIcon();
 } else {
     $initialCommission = MM_Utils::getCrossIcon();
 }
 if ($profile->rebillCommissionsEnabled()) {
     $rebillCommissions = MM_Utils::getCheckIcon() . " ";
     $rebillCommissions .= "<span style='font-family:courier;'>{$profile->getRebillConfigDescription()}</span>";
 } else {
     $rebillCommissions = MM_Utils::getCrossIcon();
 }
 if ($profile->doReverseCommissions()) {
     $doReverseCommissions = MM_Utils::getCheckIcon();
 } else {
     $doReverseCommissions = MM_Utils::getCrossIcon();
 }
 // Actions
 $editActionUrl = 'onclick="mmjs.edit(\'mm-commission-profiles-dialog\', \'' . $item->id . '\')"';
 $deleteActionUrl = 'onclick="mmjs.remove(\'' . $item->id . '\')"';
 $actions = MM_Utils::getEditIcon("Edit Commission Profile", '', $editActionUrl);
 if (!$profile->hasAssociations()) {
     $actions .= MM_Utils::getDeleteIcon("Delete Commission Profile", 'margin-left:5px;', $deleteActionUrl);
 } else {