summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 19123c0)
raw | patch | inline | side by side (parent: 19123c0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Oct 2008 12:32:29 +0000 (12:32 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 8 Oct 2008 12:32:29 +0000 (12:32 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12629 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc b/gosa-plugins/goto/admin/systems/goto/class_gotoLpdEnabled.inc
index 8303b1d4a5a14d1ff6d581ccc6cdb3af9d9e5d8e..8c8152522061c1045ebda419b1d0af924b67a2fe 100644 (file)
/* Option predefinition */
private $a_Types = array();
- private $a_Boolean = array();
private $a_FlowControls = array(); //
private $a_Parities = array(); //
private $a_Speeds = array(); //
public $attributes = array("s_Type","s_Device","i_Port","s_Options","s_WriteOnly",
"s_Speed","s_FlowControl","s_Parity","i_Bit");
+ /*! \brief Create gotoLpdEnable dialog, allows to edit printer settings.
+ @param Object $config The GOsa configuration object.
+ @param Array $data The values for attribute 'gotoLpdEnable'
+ e.g. array("USB:/dev/usb/lp0:9100:9600:S:E:0:Y:options",
+ "USB:/dev/usb/lp1:9101:9600:S:E:5:Y:", ...)
+ @param Object $parent A reference to the parent plugin-object.
+ @return Object gotoLpdEnable (plugin)
+ */
public function __construct($config,$data,&$parent)
{
plugin::plugin($config,NULL);
$this->parent = $parent;
$this->DevID = 0;
- /****
- Predefine values
- ****/
+ /* Predefine selectable values
+ */
$this->a_Types = array(
"USB" => _("USB"),
"Parallel" => _("Parallel port"),
"Serial" => _("Serial"));
- $this->a_Boolean = array(
- "Y" => _("Yes"),
- "N" => _("No"));
$this->a_FlowControl = array(
"S" => _("Software"),
"H" => _("Hardware"));
if(count($data) == 0){
$this->is_account = FALSE;
}else{
- $this->is_account = TRUE;
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
*/
foreach($this->attributes as $attr){
$this->$attr = $this->data[$this->DevID][$attr];
}
+ $this->is_account = TRUE;
+ }
}
$this->initially_was_account = $this->is_account;
}
+
+ /*! \brief Create HTML output of this plugin.
+ Depending on the current plugin status, there is a
+ 'create' and a 'remove'account button displayed on top
+ followed by the gotoLpdEnable options.
+ @param .
+ @return String HTML content
+ */
public function execute()
{
$display = "";
foreach($this->attributes as $attr){
$smarty->assign($attr,$this->$attr);
}
- foreach(array("DevID","a_Types","a_Boolean","a_FlowControl","a_Parities","a_Speeds","a_Bits") as $attr){
+ foreach(array("DevID","a_Types","a_FlowControl","a_Parities","a_Speeds","a_Bits") as $attr){
$smarty->assign($attr,$this->$attr);
}
ksort($this->data);
}
+ /*! \brief Checks the given informations and returns an array
+ with the error messages or an empty array if everything went fine.
+ @param .
+ @return Array of Strings Error messages.
+ */
public function check()
{
$messages = plugin::check();
}
+ /*! \brief Save all ui inputs.
+ @param .
+ @return .
+ */
public function save_object()
{
if(!$this->is_account) return;
}
}
+
+ /*! \brief Creates an array containing all gotoLpdEnabled values,
+ see constructor for more details.
+ @param .
+ @return Array of gotoLpdEnabled Strings.
+ */
public function save()
{
$ret = array();
}
- /* Allow every action, check are made in class service not here.
- */
+ /*! \brief .
+ @param .
+ @return .
+ */
public function acl_is_writeable($attr,$skip_write = FALSE)
{
return(TRUE);
}
+
+
+ /*! \brief .
+ @param .
+ @return .
+ */
public function acl_is_removeable($skip_write = FALSE)
{
return(TRUE);
}
+
+
+ /*! \brief .
+ @param .
+ @return .
+ */
public function acl_is_createable($skip_write = FALSE)
{
return(TRUE);
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
index 2a580e10f0a197e2cc12128416e9c33ceffe5b97..d987e441f2af948bb6ee531f082559d8f81e0dbc 100644 (file)
class termservice extends plugin
{
/* Generic terminal attributes */
- var $gotoLpdEnable= FALSE;
var $gotoXMonitor= "";
var $gotoXMethod= "default";
var $gotoXdmcpServer= "";
var $gotoScannerBackend= "";
var $goFonHardware= "automatic";
+ var $gotoLpdEnable = array();
+
var $AutoSync = false;
var $view_logged = FALSE;
/* attribute list for save action */
var $attributes= array("gotoLpdEnable", "gotoXMonitor", "gotoXMethod", "gotoXdmcpServer",
"gotoXDriver", "gotoXResolution", "gotoXColordepth",
- "gotoXHsync", "gotoXVsync", "gotoLpdEnable", "gotoLpdServer",
+ "gotoXHsync", "gotoXVsync", "gotoLpdServer",
"gotoScannerEnable", "gotoScannerModel", "gotoScannerClients",
"gotoScannerBackend", "gotoXKbModel", "gotoXKbLayout", "gotoXKbVariant",
"gotoXMouseType", "gotoXMouseport", "goFonHardware");
$this->is_ogroup_member = TRUE;
}
+ /* Load gotoLpdEnable
+ */
+ $this->gotoLpdEnable = array();
+ if(isset($this->attrs['gotoLpdEnable']['count'])){
+ for($i = 0 ; $i < $this->attrs['gotoLpdEnable']['count']; $i ++){
+ $this->gotoLpdEnable[] = $this->attrs['gotoLpdEnable'][$i];
+ }
+ }
+
/* Get list of available xdrivers */
$this->XDrivers = $this->getListOfXDrivers();
}
}
- /* Convert gotoLpdEnable
- */
- $this->gotoLpdEnable= preg_match("/yes/i",$this->gotoLpdEnable);
-
/* Load hardware list */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
return ($display);
}
+
+ /**********
+ gotoLpdEnable
+ **********/
+ if(isset($_POST['gotoLpdEnable_Close'])){
+ $this->dialog = NULL;
+ }
+
+ if(isset($_POST['gotoLpdEnable_Ok'])){
+ $this->dialog->save_object();
+ $msgs = $this->dialog->check();
+ if(count($msgs)) {
+ msg_dialog::displayChecks($msgs);
+ }else{
+ $this->gotoLpdEnable = $this->dialog->save();
+ $this->dialog = NULL;
+ }
+ }
+
+ if(isset($_POST['gotoLpdEnable_Edit'])){
+ $this->dialog = new gotoLpdEnable($this->config,$this->gotoLpdEnable,$this);
+ }
+
+ if($this->dialog instanceof plugin){
+ $this->dialog->save_object();
+ return($this->dialog->execute());
+ }
+
+ /**********
+ Ende: gotoLpdEnable
+ **********/
+
+
/* Show main page */
$smarty= get_smarty();
$smarty->assign("staticAddress", "");
/* Checkboxes */
- foreach(array("gotoLpdEnable", "gotoScannerEnable") as $val){
+ foreach(array("gotoScannerEnable") as $val){
if ($this->$val == TRUE) {
$smarty->assign("$val", "checked");
} else {
/* Save checkbox state */
if (isset ($_POST['gotoXMethod'])){
- foreach (array("gotoLpdEnable", "gotoScannerEnable") as $val){
+ foreach (array("gotoScannerEnable") as $val){
if($this->acl_is_writeable($val)){
if (!isset ($_POST["$val"])){
/* Save to LDAP */
function save()
{
- /* Convert to string */
- $this->gotoLpdEnable= $this->gotoLpdEnable?"Yes":"No";
-
/* remove objectclass GOhard if this is an ogroup tab */
if(isset($this->parent->by_object['ogroup'])){
$this->objectclasses = array();
"plCategory" => array("terminal"),
"plProvidedAcls"=> array(
+
"gotoXMonitor" => _("Monitor"),
"gotoXMethod" => _("Method"),
"gotoXdmcpServer" => _("Remote desktop"),
"gotoXHsync" => _("HSync"),
"gotoXVsync" => _("VSync"),
"AutoSync" => _("Auto-Sync"),
- "gotoLpdEnable" => _("Printer service enabled"),
"gotoLpdServer" => _("Spool server"),
"gotoScannerEnable" => _("Scanner enabled"),
"gotoXKbModel" => _("Keyboard model"),
"gotoXKbVariant" => _("Keyboard variant"),
"gotoXMouseType" => _("Mouse type"),
"gotoXMouseport" => _("Mouse port"),
+ "gotoLpdEnable" => _("Printer enabled"),
"goFonHardware" => _("Telephone hardware"))
));
}
diff --git a/gosa-plugins/goto/admin/systems/goto/terminalService.tpl b/gosa-plugins/goto/admin/systems/goto/terminalService.tpl
index 0d5d1b527c3ca1b55001d7de14636626ee9f2ac7..a268d8ba5491ea59d8fa9ea00a9f996a2aadb519 100644 (file)
</table>
<table style="width:100%;" summary="">
- <tr><td><p class="plugbottom" style="margin-top:0px;"></p></td></tr>
<tr>
- <td style="vertical-align:top;">
+ <td colspan="2">
+ <p class="plugbottom" style="margin-top:0px;">
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td style="vertical-align:top; width:50%;">
<h2><img class="center" alt="" align="middle" src="plugins/goto/images/scanner.png"> {t}Scan device{/t}</h2>
{render acl=$gotoScannerEnableACL}
<input type=checkbox name="gotoScannerEnable" value="1" title="{t}Select to start SANE scan service on terminal{/t}" {$gotoScannerEnable} >
{/render}
{t}Provide scan services{/t}
+
</td>
+ <td>
+ <h2><img class="center" alt="" src="plugins/systems/images/select_printer.png"> {t}Printer{/t}</h2>
+
+{render acl=$gotoLpdEnableACL}
+ <input type='submit' name='gotoLpdEnable_Edit' value='{msgPool type=editButton}'>
+{/render}
+ </td>
</tr>
</table>