if ($c_package[0]['ERR'] && $c_package[0]['ERR'] == 'PULSE2ERROR_GETALLPACKAGE') { $err[] = sprintf(_T("MMC failed to contact package server %s.", "msc"), $c_package[0]['mirror']); } else { $a_packages[] = $package->label; $a_description[] = $package->description; $a_pversions[] = $package->version; $a_sizes[] = prettyOctetDisplay($package->size); if ($group != null) { $current_convergence_status = getConvergenceStatus($p_api->mountpoint, $package->id, $group_convergence_status, $package->associateinventory); // set param_convergence_edit to True if convergence status is active or inactive $param_convergence_edit = in_array($current_convergence_status, array(1, 2)) ? True : False; $a_convergence_status[] = prettyConvergenceStatusDisplay($current_convergence_status); $a_convergence_action[] = $package->associateinventory ? $convergenceAction : $emptyAction; } if (!empty($_GET['uuid'])) { $params[] = array('name' => $package->label, 'version' => $package->version, 'pid' => $package->id, 'uuid' => $_GET['uuid'], 'hostname' => $_GET['hostname'], 'from' => 'base|computers|msctabs|tablogs', 'papi' => $p_api->toURI()); } else { $params[] = array('name' => $package->label, 'version' => $package->version, 'pid' => $package->id, 'gid' => $group->id, 'from' => 'base|computers|groupmsctabs|tablogs', 'papi' => $p_api->toURI(), 'editConvergence' => $param_convergence_edit); } if ($type == 0) { $a_css[] = 'primary_list'; } else { $a_css[] = 'secondary_list'; } } } if ($err) { new NotifyWidgetFailure(implode('<br/>', array_merge($err, array(_T("Please contact your administrator.", "msc"))))); } $n = new OptimizedListInfos($a_packages, _T("Package", "msc")); $n->addExtraInfo($a_description, _T("Description", "msc"));
function loadList() { $filter = array('group' => $this->group->id, 'filter' => ''); list($count, $packages) = advGetAllPackages($filter, 0, -1); $this->list = array(); foreach ($packages as $c_package) { $p_api = new ServerAPI($c_package[2]); if ($c_package[0]['ERR'] && $c_package[0]['ERR'] == 'PULSE2ERROR_GETALLPACKAGE') { $this->err[] = sprintf(_T("MMC failed to contact package server %s.", "msc"), $c_package[0]['mirror']); } else { $this->list[$c_package[0]['id'] . '##' . base64_encode(serialize($p_api->toURI()))] = $c_package[0]['label'] . " (" . $c_package[0]['version'] . ")"; } } }