summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7652628)
raw | patch | inline | side by side (parent: 7652628)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jan 2010 13:21:59 +0000 (13:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Jan 2010 13:21:59 +0000 (13:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15374 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/personal/environment/class_hotplugDialog.inc | [deleted file] | patch | blob | history |
gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc | [deleted file] | patch | blob | history |
gosa-plugins/goto/personal/environment/hotplugDialog.tpl | [deleted file] | patch | blob | history |
gosa-plugins/goto/personal/environment/selectPrinterDialog.tpl | [deleted file] | patch | blob | history |
diff --git a/gosa-plugins/goto/personal/environment/class_hotplugDialog.inc b/gosa-plugins/goto/personal/environment/class_hotplugDialog.inc
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-class hotplugDialog extends plugin
-{
- /* attribute list for save action */
- var $hotplugDevices = "";
- var $hotplugDeviceList = array();
- var $regex = "*";
- var $depselect = "/";
- var $deplist = "/";
- var $skipThese = array();
-
- function hotplugDialog (&$config,$skipThese = array())
- {
- $this->skipThese = $skipThese;
- $this->config = $config;
- $this->depselect = session::get('CurrentMainBase');
- }
-
- function execute()
- {
- /* Call parent execute */
- plugin::execute();
-
- /* Fill templating stuff */
- $smarty= get_smarty();
- $display= "";
-
- if(isset($_POST['dialogissubmitted'])){
- $this->regex=$_POST['regexHot'];
- $this->depselect = $_POST['depselectHot'];
- }
-
- if((isset($_GET['search']))&&(!empty($_GET['search']))){
- $this->regex=$_GET['search']."*";
- $this->regex=preg_replace("/\*\*/","*",$this->regex);
- }
-
- $this->deplist=$this->config->idepartments;
-
- $this->hotplugDevices = $this->getHotplugs();
- $smarty->assign("regexHot" ,$this->regex);
- $smarty->assign("deplistHot" ,$this->deplist);
- $smarty->assign("depselectHot",$this->depselect);
- $smarty->assign("apply", apply_filter());
- $smarty->assign("alphabet", generate_alphabet());
- $smarty->assign("search_image", get_template_path('images/lists/search.png'));
- $smarty->assign("tree_image", get_template_path('images/lists/search-subtree.png'));
- $smarty->assign("launchimage", get_template_path('images/lists/action.png'));
- $smarty->assign("deplist", $this->config->idepartments);
-
-
- $smarty->assign("hotplugDevices",$this->hotplugDevices);
- $smarty->assign("hotplugDeviceKeys",array_flip($this->hotplugDevices));
- $display.= $smarty->fetch(get_template_path('hotplugDialog.tpl', TRUE,dirname(__FILE__)));
- return($display);
- }
-
- function check(){
- /* Call common method to give check the hook */
- $message= plugin::check();
-
- if(empty($_POST['hotplugName'])){
- $message[] = _("Please select a hotplug device!");
- }
- return $message;
- }
-
-
- /* Save to LDAP */
- function save()
- {
- $entries = array();
- foreach($_POST['hotplugName'] as $name){
- $entries[$name] = $this->hotplugDeviceList[$name];
- }
-
- return $entries;
- }
-
- function getHotplugs()
- {
- $ldap= $this->config->get_ldap_link();
- $ldap->cd(get_ou('deviceRDN').$this->depselect);
- $ldap->search("(&(objectClass=gotoDevice)(|(cn=".$this->regex.")(description=".$this->regex.")))",array("gotoHotplugDevice","cn","dn"));
-
- $a_return = array();
- $this->hotplugDeviceList = array();
- while($attr = $ldap->fetch()){
-
- if(isset($attr['gotoHotplugDevice'][0])){
-
- $hot_plug = $attr['gotoHotplugDevice'][0];
- $tmp = preg_split("/\|/",$hot_plug);
- $tmp2 = array();
-
- if(in_array($attr['cn'][0],$this->skipThese)){
- continue;
- }
-
- $tmp2['name'] = $attr['cn'][0];
- $tmp2['description'] = $tmp[0];
- $tmp2['id'] = $tmp[1];
- $tmp2['produkt'] = $tmp[2];
- $tmp2['vendor'] = $tmp[3];
- $tmp2['dn'] = $attr['dn'];
-
- $a_return[$attr['cn'][0]]= $attr['cn'][0]." [".$tmp[0]."] ".$tmp[1];
-
- $this->hotplugDeviceList[$attr['cn'][0]]=$tmp2;
- }
- }
- uksort($a_return,"strnatcasecmp");
- return($a_return);
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc b/gosa-plugins/goto/personal/environment/class_selectPrinterDialog.inc
+++ /dev/null
@@ -1,159 +0,0 @@
-<?php
-
-class selectPrinterDialog extends plugin
-{
- /* attribute list for save action */
- var $ignore_account = TRUE;
- var $attributes = array();
- var $objectclasses = array("whatever");
- var $AlreadyAssigned = array();
- var $regex = "*";
- var $depselect = "/";
- var $deplist = array("/");
- var $module = array("printer");
- var $ui = NULL;
- var $subtreesearch = FALSE;
-
- function selectPrinterDialog (&$config, $dn= NULL,$alreadyused=array() )
- {
- $this->AlreadyAssigned = $alreadyused;
- plugin::plugin ($config, $dn);
-
- /* Get all departments within this subtree */
- $base = $this->config->current['BASE'];
-
- /* Add base */
- $tmp = array();
- $tmp[] = array("dn"=>$this->config->current['BASE']);
- $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
- array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
-
- $deps = array();
- foreach($tmp as $tm){
- $deps[$tm['dn']] = $tm['dn'];
- }
-
-
- /* Load possible departments */
- $ui= get_userinfo();
- $this->ui = $ui;
- $tdeps= $ui->get_module_departments("printer");
- $ids = $this->config->idepartments;
- $first = "";
- $found = FALSE;
- $res = array();
- foreach($ids as $dep => $name){
- if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
- $res[$dep] = $ids[$dep]; //$tdeps[$dep];
- }
- }
- $this->deplist = $res;
- $this->depselect = key($res);
- }
-
- function execute()
- {
- /* Call parent execute */
- plugin::execute();
-
- /* Fill templating stuff */
- $smarty= get_smarty();
- $display= "";
-
- if(isset($_POST['dialogissubmitted'])){
- foreach(array('regexPrinter' => 'regex','depselectPrinter'=>'depselect') as $attr => $name){
- if(isset($_POST[$attr])){
- $this->$name =$_POST[$attr];
- }
- }
- }
-
- if(isset($_POST['subtrees'])){
- $this->subtreesearch= TRUE;
- } else {
- $this->subtreesearch= FALSE;
- }
-
- if((isset($_GET['search']))&&(!empty($_GET['search']))){
- $this->regex=$_GET['search']."*";
- $this->regex=preg_replace("/\*\*/","*",$this->regex);
- }
-
- $printer_list = $this->getPrinter();
- asort($printer_list);
-
- $smarty->assign("regexPrinter" ,$this->regex);
- $smarty->assign("deplistPrinter" ,$this->deplist);
- $smarty->assign("depselectPrinter",$this->depselect);
- $smarty->assign("gotoPrinters",$printer_list);
- $smarty->assign("apply", apply_filter());
- $smarty->assign("alphabet", generate_alphabet());
- $smarty->assign("subtrees", $this->subtreesearch?"checked":"");
- $smarty->assign("search_image", get_template_path('images/lists/search.png'));
- $smarty->assign("tree_image", get_template_path('images/lists/search-subtree.png'));
- $smarty->assign("infoimage", get_template_path('images/info.png'));
- $smarty->assign("launchimage", get_template_path('images/lists/action.png'));
- $smarty->assign("deplist", $this->config->idepartments);
-
- $display.= $smarty->fetch(get_template_path('selectPrinterDialog.tpl', TRUE,dirname(__FILE__)));
- return($display);
- }
-
- function check(){
- /* Call common method to give check the hook */
- $message= plugin::check();
-
- if(empty($_POST['gotoPrinter'])){
- $message[] = _("Please select a printer!");
- }
- return $message;
- }
-
- /* Save to LDAP */
- function save()
- {
- return($_POST['gotoPrinter']);
- }
-
- /* This function generates the Printerlist
- * All printers are returned that match regex and and depselect
- */
- function getPrinter($detailed = false)
- {
- $a_return=array();
-
-
- $filter = "(&(objectClass=gotoPrinter)(cn=".$this->regex."))";
- $module = $this->module;
- $base = $this->depselect;
- $attrs = array("cn","description");
-
- if ($this->subtreesearch){
- $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT | GL_SUBSEARCH);
- } else {
- $base= get_ou('printerRDN').$base;
- $res = get_list($filter,$module,$base,$attrs, GL_SIZELIMIT );
- }
-
- foreach($res as $printer) {
- $acl = $this->ui->get_permissions($printer['dn'],"printer/printgeneric","gotoUserPrinter");;
- if(!preg_match("/w/",$acl)){
- continue;
- }
- if(isset($this->AlreadyAssigned[$printer['cn'][0]])) continue;
- if($detailed ==true){
- $a_return[$printer['cn'][0]] = $printer;
- }else{
- if(isset($printer['description'][0])){
- $a_return[$printer['cn'][0]] = $printer['cn'][0]." - ".$printer['description'][0];
- }else{
- $a_return[$printer['cn'][0]] = $printer['cn'][0];
- }
- }
- }
- return($a_return);
- }
-}
-
-// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
-?>
diff --git a/gosa-plugins/goto/personal/environment/hotplugDialog.tpl b/gosa-plugins/goto/personal/environment/hotplugDialog.tpl
+++ /dev/null
@@ -1,70 +0,0 @@
-<h2><img class="center" alt="" src="plugins/goto/images/hotplug.png" align="middle"> {t}Add hotplug devices{/t}</h2>
-
- <input type="hidden" name="dialogissubmitted" value="1">
-
- <table summary="{t}Hotplug management{/t}" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4 cellspacing=2>
- <tr>
- <td style="vertical-align:top;">
- <div class="contentboxh" style="height:20px;">
- <p class="contentboxh" style="font-size:12px">
- <b><LABEL for="hotplugName">{t}Select hotplug device to add{/t}</LABEL></b>
- </p>
- </div>
- <div class="contentboxb">
- <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <select style="width:100%;height:450px" size=20 name="hotplugName[]" id="hotplugName" multiple>
- {html_options values=$hotplugDeviceKeys output=$hotplugDevices}
- <option disabled> </option>
- </select><br>
- </p>
- </div>
- </td>
- <td style="vertical-align:top; width:350px">
- <div class="contentboxh" style="height:20px">
- <p class="contentboxh" style="font-size:12px"><img src="{$launchimage}" align="right" alt="[F]">{t}Filters{/t}</p>
- </div>
- <div class="contentboxb">
- <table summary="" style="width:100%;border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- {$alphabet}
- </table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <tr>
- <td>
- <img class="center" alt="" src="{$tree_image}" align=middle>
- <select name="depselectHot" size=1 onChange="mainform.submit()" title="{t}Choose the department the search will be based on{/t}">
- {html_options options=$deplistHot selected=$depselectHot}
- </select>
- </td>
- </tr>
- </table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <tr>
- <td>
- <LABEL for='filter'><img class="center" alt="Search" src="{$search_image}" align="middle" title="{t}Display users matching{/t}">
- </LABEL>
- </td>
- <td width="99%">
- <input id='filter' style='width:99%' type='text' name='regexHot' maxlength='20' value='{$regexHot}'
- title='{t}Regular expression for matching hotplugs{/t}' onChange="mainform.submit()">
- </td>
- </tr>
- </table>
- {$apply}
- </div>
- </td>
-
-
- </tr>
- </table>
-
- <p class="seperator"> </p>
-
- <p align="right">
- <input type="submit" name="HotPlugSave" value="{msgPool type=addButton}">
- <input type="submit" name="HotPlugCancel" value="{msgPool type=cancelButton}">
- </p>
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- focus_field('hotplugName');
- -->
-</script>
diff --git a/gosa-plugins/goto/personal/environment/selectPrinterDialog.tpl b/gosa-plugins/goto/personal/environment/selectPrinterDialog.tpl
+++ /dev/null
@@ -1,72 +0,0 @@
-<h2><img class="center" alt="" src="plugins/systems/images/select_printer.png" align="middle"> {t}Add printer devices{/t}</h2>
-
- <input type="hidden" name="dialogissubmitted" value="1">
-
- <table summary="{t}Select printer to add{/t}" style="width:100%; vertical-align:top; text-align:left;" cellpadding=4>
- <tr>
- <td>
- <div class="contentboxh" style="height:20px;">
- <p class="contentboxh" style="font-size:12px">
- <b><LABEL for="gotoPrinter">{t}Select printer to add{/t}</LABEL></b>
- </p>
- </div>
- <div class="contentboxb">
- <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <select style="width:100%;height:450px" size=20 name="gotoPrinter[]" id="gotoPrinter" multiple>
- {html_options options=$gotoPrinters}
- <option disabled> </option>
- </select><br>
- </p>
- </div>
- </td>
- <td valign="top" style="width:350px">
- <div class="contentboxh" style="height:20px">
- <p class="contentboxh" style="font-size:12px"><img src="{$launchimage}" align="right" alt="[F]">{t}Filters{/t}</p>
- </div>
- <div class="contentboxb">
- <table summary="" style="width:100%;border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- {$alphabet}
- </table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <tr>
- <td>
- <img class="center" alt="" src="{$tree_image}" align=middle>
- <select name="depselectPrinter" size=1 onChange="mainform.submit()" title="{t}Choose the department the search will be based on{/t}">
- {html_options options=$deplistPrinter selected=$depselectPrinter}
- </select>
- </td>
- </tr>
- </table>
- <table summary="" style="width:100%;border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <tr><td>
- <input type=checkbox name="subtrees" value="1" {$subtrees} onClick="mainform.submit()" title="{t}Select to search within subtrees{/t}">{t}Search in subtrees{/t}
- </tr></td>
- </table>
- <table summary="" width="100%" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
- <tr>
- <td>
- <LABEL for='filter'><img class="center" alt="Search" src="{$search_image}" align="middle" title="{t}Display printers matching{/t}">
- </LABEL>
- </td>
- <td width="99%">
- <input id='filter' style='width:99%' type='text' name='regexPrinter' maxlength='20' value='{$regexPrinter}'
- title='{t}Regular expression for matching printer names{/t}' onChange="mainform.submit()">
- </td>
- </tr>
- </table>
- {$apply}
- </div>
- </td>
- </tr>
- </table>
-
- <p class="seperator"> </p>
- <p align="right">
- <input type="submit" name="PrinterSave" value="{msgPool type=addButton}">
- <input type="submit" name="PrinterCancel" value="{msgPool type=cancelButton}">
- </p>
-<script language="JavaScript" type="text/javascript">
- <!-- // First input field on page
- focus_field('gotoPrinter');
- -->
-</script>