summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea72acb)
raw | patch | inline | side by side (parent: ea72acb)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Apr 2008 13:34:25 +0000 (13:34 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 11 Apr 2008 13:34:25 +0000 (13:34 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10362 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiPackage.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index b299e7c40a35d362510361945e2391315d747440..91ff14b43e445a0d1ee73c43849621b04c7c00b2 100644 (file)
$smarty->assign($attrs,$this->$attrs);
}
- /* Generate package list */
- $this->list= $this->genPkgs();
-
/* + was pressed to open the package dialog */
if(isset($_POST['Addpkg']) && $this->acl_is_writeable("FAIpackage")){
$this->dialog = new faiPackageEntry($this->config, $this->FAIdebianRelease,$this->usedPackages);
unset($this->usedPackages[$del]);
}
}
+
+ /* Generate package list */
+ $this->list= $this->genPkgs(TRUE);
}
}
$this->dialog = false;
$this->is_dialog=false;
ksort($this->usedPackages);
+
+ /* Generate package list */
+ $this->list= $this->genPkgs(TRUE);
}
}else{
$this->dialog = false;
$pkg= preg_replace('/^/', '-', $pkg);
}
$this->usedPackages[$pkg]= $pkg;
+
}
}
+
+ /* Generate package list */
+ $this->list= $this->genPkgs(TRUE);
}
}
return ($message);
}
- function printUsedPackages(){
+
+ function printUsedPackages()
+ {
$a_ret=array();
- if(is_array($this->usedPackages)) {
+ if(is_array($this->usedPackages)){
foreach($this->usedPackages as $usedName){
- $config = 0;
-
- foreach($this->ConfiguredPackages as $name => $value){
- if($name == $usedName){
- $config ++;
- }
- }
-
+ /* Append message if package is configured */
$c_str ="";
- if($config){
+ if(isset($this->ConfiguredPackages[$usedName])){
$c_str = " - "._("package is configured");
}
$dsc= "";
if (preg_match('/^-/', $usedName)){
$dsc= " - "._("Package marked for removal");
- // Generally a bad idea here, because the toggel triggers on -, not on !
- //$usedName= preg_replace('/^-/', '! ', $usedName);
}else{
$usedName2= $usedName;
}
- if(isset($this->list[$usedName][1])){
- $a_ret[$usedName] = $usedName2." [".$this->list[$usedName][1]."]".$c_str.$dsc;
+ /* Append version string, if available */
+ if(isset($this->list[$usedName]['VERSION'])){
+ $a_ret[$usedName] = $usedName2." [".$this->list[$usedName]['VERSION']."]".$c_str.$dsc;
}else{
$a_ret[$usedName] = $usedName2.$c_str.$dsc;
}
}
- function genPkgs()
+ function genPkgs($force = false)
{
- $start = microtime(1);
- if($this->buffer === NULL || !count($this->buffer)){
- $this->buffer = array();
+ if(!count($this->buffer) || $force){
$q = new gosaSupportDaemon();
$attrs = array("distribution", "package","version", "section", "description", "timestamp");
- $ret = $q->FAI_get_packages($this->FAIdebianRelease,$attrs);
+ $ret = $q->FAI_get_packages($this->FAIdebianRelease,$attrs,$this->usedPackages);
if($q->is_error()){
msg_dialog::display(_("Service infrastructure"),msgPool::siError($q->get_error()),ERROR_DIALOG);
}else{
foreach($ret as $attr){
- $this->buffer[$attr['PACKAGE']] = array($attr['PACKAGE'],$attr['VERSION'],$attr['SECTION'],$attr['DESCRIPTION']);
+ $this->buffer[$attr['PACKAGE']] = $attr;
}
}
}
-
-# printf("%0.6f",(microtime(1) - $start));
return $this->buffer;
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPackageEntry.inc
index 4d4dd3b35707f73e02ff0f71b1babc01e6bb7d43..82dfc595d9831ec497dd43730cf6aa757491cb04 100644 (file)
{
$this->pkgs = array();
$q = new gosaSupportDaemon();
- $filter = preg_replace("/\*/","%",$this->searchStrPKG);
+ $filter = preg_replace("/\*/","%",array($this->searchStrPKG));
$attrs = array("distribution", "package","version", "section", "description", "timestamp");
$ret = $q->FAI_get_packages($this->FAIdebianRelease,$attrs,$filter);
if($q->is_error()){