summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3cd4264)
raw | patch | inline | side by side (parent: 3cd4264)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Oct 2008 05:34:30 +0000 (05:34 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Oct 2008 05:34:30 +0000 (05:34 +0000) |
-Hide selection
-Fixed WriteOnly Box
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12634 594d385d-05f5-0310-b6e9-bd551577e9d8
-Fixed WriteOnly Box
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12634 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc | patch | blob | history | |
gosa-plugins/goto/admin/systems/goto/gotoLpdEnable.tpl | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc b/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc
index 8c8152522061c1045ebda419b1d0af924b67a2fe..f3848c291d06652ec6f90619d683a946d55f9d35 100644 (file)
$this->is_account = FALSE;
}else{
foreach($data as $dat){
-
if(substr_count($dat,":") < 8) continue;
-
list($s_Type,$s_Device,$i_Port,$s_Speed,$s_FlowControl,$s_Parity,$i_Bit,$s_WriteOnly,$s_Options) = split("\:",$dat);
$entry = array();
foreach($this->attributes as $attr){
$this->data[] = $entry;
}
- if(count($this->data)){
/* Set first entry values
+ From "$this->data[0]" to "$this->"
*/
- foreach($this->attributes as $attr){
- $this->$attr = $this->data[$this->DevID][$attr];
- }
+ if(count($this->data)){
+ foreach($this->attributes as $attr){
+ $this->$attr = $this->data[$this->DevID][$attr];
+ }
$this->is_account = TRUE;
}
}
public function execute()
{
$display = "";
+
+ /* Handle account add/remove
+ */
if(isset($_POST['modify_state'])){
$this->is_account = !$this->is_account;
+
+ /* Reset account or create a new one
+ */
if(!$this->is_account){
$this->data = array();
}else{
+
+ /* Initialize plugin with default entries
+ */
$entry = $this->default_entry;
$entry['i_Port'] = $entry['i_Port'] + count($this->data);
$entry['s_Device'] = $entry['s_Device'].count($this->data);
}
}
+ /* Add toggle plugin buttons on top of the generated page
+ */
if($this->is_account){
$display .= $this->show_disable_header(msgPool::removeFeaturesButton(_("Printer")),"",FALSE);
}else{
$display .= $this->show_enable_header(msgPool::addFeaturesButton(_("Printer")),"",FALSE);
}
+
+ /* Set smarty variables
+ */
$smarty = get_smarty();
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
$smarty->assign("data_cnt",count($this->data));
$smarty->assign("data",$this->data);
$smarty->assign("a_DevIDs",array_keys($this->data));
- $smarty->assign("s_WriteOnly", $this->s_WriteOnly == "Y");
$smarty->assign("is_account",$this->is_account);
return($display.$smarty->fetch(get_template_path("gotoLpdEnable.tpl",TRUE,dirname(__FILE__))));
}
*/
public function save_object()
{
- if(!$this->is_account) return;
+ if(!$this->is_account || !isset($_POST['gotoLpdEnable_entry_posted'])){
+ return;
+ }
+
+ /* Check if we have to propose device settings
+ (current device info is empty and the printer type has changed)
+ */
$propose_device = "";
if(isset($_POST['s_Device']) && empty($_POST['s_Device']) &&
isset($_POST['s_Type']) && $_POST['s_Type'] != $this->s_Type){
plugin::save_object();
- if(isset($_POST['gotoLpdEnable_entry_posted']) && isset($_POST['s_WriteOnly'])){
+ if(!empty($propose_device)){
+ $this->s_Device = $propose_device;
+ }
+
+ /* Get checkbox changes
+ */
+ if(isset($_POST['s_WriteOnly'])){
$this->s_WriteOnly = "Y";
}else{
$this->s_WriteOnly = "N";
}
- if(!empty($propose_device)){
- $this->s_Device = $propose_device;
- }
-
+ /* Write back attributes to data array ($this->data)
+ */
foreach($this->attributes as $attr){
$this->data[$this->DevID][$attr] = $this->$attr;
}
- /* Device ID has changed */
+ /* Device ID has changed another printer was selected * /
if(isset($_POST['DevID']) && $_POST['DevID'] != $this->DevID){
$this->DevID = $_POST['DevID'];
foreach($this->attributes as $attr){
$this->$attr = $this->data[$this->DevID][$attr];
}
- }
+ }
+ */
+ /* Add and remove additional printer settings
if(isset($_POST['del_printer'])){
unset($this->data[$this->DevID]);
$this->data = array_values($this->data);
}
}
}
+ */
}
diff --git a/gosa-plugins/goto/admin/systems/goto/gotoLpdEnable.tpl b/gosa-plugins/goto/admin/systems/goto/gotoLpdEnable.tpl
index 7c29c989b4fd45ebb5ad41e946ec3a5f0f38825b..b1899f0c02948096ad78bb892c5b6dfa0514e9b8 100644 (file)
<tr>
<td style='width:55%;'>
<table>
+<!--
<tr>
<td>{t}Device{/t} #</td>
<td>
<input type="submit" name="del_printer" value="{msgPool type=delButton}">
</td>
</tr>
+-->
<tr>
<td>{t}Type{/t}</td>
<td>
<tr>
<td>{t}Write only{/t}</td>
<td>
- <input {if $s_WriteOnly} checked {/if} type='checkbox' name='s_WriteOnly' value='Y' >
+ <input {if $s_WriteOnly == "Y"} checked {/if} type='checkbox' name='s_WriteOnly' value='Y' >
</td>
</tr>
</table>