summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7784116)
raw | patch | inline | side by side (parent: 7784116)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Aug 2009 07:56:50 +0000 (07:56 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Aug 2009 07:56:50 +0000 (07:56 +0000) |
- Allow to remove multiple physical partitions.
- Allow user defined partition names (cn).
- Updated FAIpartitionTable class, do not act on POST in save_object while
we are in sub dialogs.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13976 594d385d-05f5-0310-b6e9-bd551577e9d8
- Allow user defined partition names (cn).
- Updated FAIpartitionTable class, do not act on POST in save_object while
we are in sub dialogs.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13976 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
index a3819d5cece1bb74199064ece9796d43f90417a7..3e3f8cc2aa1bfa70413d8d140bdccbf0e90126b1 100644 (file)
$s_entry = "";
$display = "";
- // Remove partition
+ // Add partition to lvm compilation.
if(isset($_POST['addLvmPartition']) && isset($_POST['lvmPartitionAdd'])){
- $name = $_POST['lvmPartitionAdd'];
+ $name = get_post('lvmPartitionAdd');
$this->lvmDevices[$name] = $name;
}
+ // Remove partition from lvm compilation.
+ if(isset($_POST['delLvmPartition']) && isset($_POST['physicalPartition'])){
+ $names = $_POST['physicalPartition'];
+ foreach($names as $name){
+ if(isset($this->lvmDevices[$name])){
+ unset($this->lvmDevices[$name]);
+ }
+ }
+ }
+
/* Check all Posts if there is something usefull for us,
* For example : Delete is posted as Delete_1
* The number specifies the index we want to delete
{
if(!isset($part['FAIpartitionNr']) || $part['FAIpartitionNr'] == "undefined"){
$part['FAIpartitionNr'] = count($this->partitions) + 1;
+ }
+
+ /* Update the disk cn -
+ * Do NOT touch the partition 'cn' in case of lvm devices.
+ */
+ if($this->FAIdiskType == "disk"){
$part['cn'] = $this->DISKcn.$part['FAIpartitionNr'];
}
- $part['cn'] = $this->DISKcn.$part['FAIpartitionNr'];
$this->partitions[$part['FAIpartitionNr']] = $part;
}
$action =array(
"string" => "<input type='image' src='images/lists/edit.png' name='EditPartition_".$key."'>".
"<input type='image' src='images/lists/trash.png' name='RemovePartition_".$key."'>",
- "attach" => "style='width:40px;'");
+ "attach" => "style='width:40px; border-right: 0px;'");
-
- $fields = array($number,$type,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action);
+ if($this->FAIdiskType == "lvm"){
+ $fields = array($type,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action);
+ }else{
+ $fields = array($number,$type,$mntp,$size,$fstype, $opt,$fsopt,$flags,$action);
+ }
$divlist->AddEntry($fields);
}
return($divlist->DrawList());
/* Attach partitions */
foreach($this->partitions as $key=>$val) {
$this->partitions[$key]['FAIpartitionNr']=$key;
- $this->partitions[$key]['cn'] = $this->DISKcn.$key;
+
+ if($this->FAIdiskType == "disk"){
+ $this->partitions[$key]['cn'] = $this->DISKcn.$key;
+ }
}
/* Attach deleted */
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index 4e8ef7eb12794a49cef746a664b44535cf976f63..296f83abd538d130afb90dce3468032be4189a7e 100644 (file)
}
}
}
+
+ print_a($object);
// Load attributes from existing partition
if($object){
}
}
+ // Allow user defined partition names for lvm disks.
+ if($this->FAIdiskType == "lvm" && isset($_POST['cn'])){
+ $this->cn = get_post('cn');
+ }
+
// Remove partition
if(isset($_POST['delPhysicalPartition']) && isset($_POST['physicalPartition'])){
unset($this->raidDevices[$_POST['physicalPartition']]);
if($this->FAIfsType == "swap"){
$ret['FAImountPoint'] = "swap";
}
-
+
return($ret);
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 492d3c882d545ffbfdbd19ae3843056f005102af..4caa07c09d8c025fc930c6402cd242d6e7735a89 100644 (file)
*/
function save_object()
{
- if (preg_match("/freeze/", $this->FAIstate)) return;
- plugin::save_object();
- foreach($this->attributes as $attrs){
- if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ if(isset($_POST['FAIpartitionTablePosted'])){
+ if (preg_match("/freeze/", $this->FAIstate)) return;
+ plugin::save_object();
+ foreach($this->attributes as $attrs){
+ if(isset($_POST[$attrs])){
+ $this->$attrs = $_POST[$attrs];
+ }
}
- }
- if(isset($_POST['faiPartitionTable'])){
if(!count($this->disks)){
if(isset($_POST['mode'])){
$this->FAIpartitionMethod = "setup-storage";
diff --git a/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl b/gosa-plugins/fai/admin/fai/faiDiskEntry.tpl
index 7e25562fae4a05e226ff773ba5449279dae6dde5..1481fd8e04476490cadf4d2f8e424a0523ab480c 100644 (file)
<h2>{t}Combined physical partitions{/t}</h2>
<select style='font-family: monospace; width: 100%;'
- name='physicalPartition' size=5>
+ name='physicalPartition[]' size=5 multiple>
{html_options options=$plist}
</select>
<br>
diff --git a/gosa-plugins/fai/admin/fai/faiPartition.tpl b/gosa-plugins/fai/admin/fai/faiPartition.tpl
index 5ca713cdc3bea78ffed7da5aba34e751653b68c7..cc4bd9f2255d5c95bf4949e1684606cb20ce2e3c 100644 (file)
{if $FAIdiskType == "lvm"}
<td>{t}Name{/t}</td>
<td width="35%">
- <input name="FAIpartitionType" value="{$FAIpartitionType}">
+ <input name="cn" value="{$cn}">
</td>
{else}
<td>{t}Type{/t}</td>
diff --git a/gosa-plugins/fai/admin/fai/faiPartitionTable.tpl b/gosa-plugins/fai/admin/fai/faiPartitionTable.tpl
index 4e976aec0f71120559d9f9e32bcb70f67eeca726..7ac1c6058c4168011ae030c4c31956eb73a49d61 100644 (file)
</td>
</tr>
</table>
-<input type='hidden' name='faiPartitionTable' value='1'>
+<input type='hidden' name='FAIpartitionTablePosted' value='1'>
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
<!-- // First input field on page