Code

Updated gotomassesschedule
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Aug 2007 12:20:58 +0000 (12:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 17 Aug 2007 12:20:58 +0000 (12:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7067 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/gotomasses/class_goto_task.inc [new file with mode: 0644]
plugins/addons/gotomasses/class_gotomasses.inc
plugins/addons/gotomasses/class_target_list.inc [new file with mode: 0644]
plugins/addons/gotomasses/goto_task.tpl [new file with mode: 0644]

diff --git a/plugins/addons/gotomasses/class_goto_task.inc b/plugins/addons/gotomasses/class_goto_task.inc
new file mode 100644 (file)
index 0000000..e5d464f
--- /dev/null
@@ -0,0 +1,261 @@
+<?php
+
+class goto_task extends plugin
+{
+  /* Definitions */
+  var $plHeadline     = "System mass deployment";
+  var $plDescription  = "This does something";
+  var $parent   = NULL;
+  var $Expert   = FALSE;
+  var $Minute   = "*";
+  var $Hour     = "*";
+  var $Day      = "*";
+  var $Month    = "*";
+  var $Weekday  = "*";
+  var $Action   = "install";
+  var $Comment  = "";
+  var $Taret    = array();
+
+  var $Actions  = array();
+
+  var $attributes     = array("Minute","Hour","Day","Month","Weekday","Action","Comment","Target");
+
+
+  function goto_task($config,$parent,$data = array())
+  {
+    /* Set parent object */
+    $this->parent = $parent;
+
+    /* Intialize plugin */
+    $this->config = $config;
+    if(count($data)){
+    
+      $tmp = $this->get_array_values();
+      foreach($this->attributes as $attr){
+        if(!isset($data[$attr])){
+          trigger_error("Missing parameter: '".$attr."' for goto_task contruction.");
+        }else{
+          $this->$attr = $data[$attr];
+  
+          /* Check if given value will be selectable via dropdown menus, else enable expert mode */
+          if(in_array($attr, array("Minute","Hour","Day","Month","Weekday")) && !isset($tmp[$attr][$data[$attr]])){
+            $this->Expert = TRUE;
+          }
+        }
+      }
+    }
+
+    /* Prepare list of available actions */
+    $this->Actions = $this->parent->get_actions();
+  }
+
+
+  function execute()
+  {
+    /********
+     * Handle Posts  
+     ********/
+  
+    /* Handle Target options */
+    foreach($_POST as $name => $value){
+      if(preg_match("/^remove_/",$name)){
+        $value = preg_replace("/^remove_([0-9]*)_(x|y)$/i","\\1",$name);
+        if(isset($this->Target[$value])){
+          unset($this->Target[$value]);
+        }
+      }
+    }
+
+    /* Add target */
+    if(isset($_POST['add_target']) && !empty($_POST['target_text'])){
+      $target = get_post("target_text");
+      if($this->is_valid_target($target) && !in_array($target,$this->Target)){
+        $this->Target[] = $target;
+      }
+    }
+    /********
+     * Add target from list 
+     ********/
+
+    /* If add from list is was requsted, display this list */ 
+    if(isset($_POST['add_from_list'])){
+      $this->dialog = new target_list($this->config,$this->Target);
+    }
+
+    /* Save selected objects as target */
+    if(isset($_POST['SaveMultiSelectWindow'])){
+      $this->dialog->save_object();
+      $ret = $this->dialog->save();
+      foreach($ret as $entry){
+        $this->Target[] = $entry['cn'][0];
+      }
+      $this->dialog = NULL;
+    }
+
+    /* Cancel object listing */
+    if(isset($_POST['CloseMultiSelectWindow'])){
+      $this->dialog = NULL;
+    }
+
+    /* Display object Listing */
+    if($this->dialog){
+      $this->dialog->save_object();
+      return($this->dialog->execute());
+    }
+
+
+    /********
+     * Display this plugin  
+     ********/
+
+    $divlist = new divlist("goto_task");
+    $divlist->SetWidth("100%");
+    $divlist->SetHeight("160");
+    $divlist->SetEntriesPerPage(0);
+
+    $divlist->SetHeader(array(
+                            array("string" => "Target"),
+                            array("string" => "Actions" , "attach" => "style='width:40px;'")));
+
+    $acl_target = $this->parent->getacl("Target");
+    foreach($this->Target as $key => $target){
+
+      $field1 = array("string" => $target);
+      if(preg_match("/w/i",$acl_target)){
+        $field2 = array("string" => "<input type='image' src='images/edittrash.png' name='remove_".$key."'>" , 
+                                    "attach" => "style='width:44px;'");
+      }else{
+        $field2 = array("string" => "",
+                                    "attach" => "style='width:44px;'");
+      }
+
+      $divlist->AddEntry(array($field1,$field2));
+    } 
+
+    $smarty = get_smarty();
+
+    foreach($this->attributes as $attr){
+      $smarty->assign($attr."ACL", $this->parent->getacl($attr));
+      $smarty->assign($attr,$this->$attr);
+    }
+
+    $tmp = $this->get_array_values();
+    $smarty->assign("Minutes" , $tmp['Minute']);
+    $smarty->assign("Hours"   , $tmp['Hour']);
+    $smarty->assign("Days"    , $tmp['Day']);
+    $smarty->assign("Months"  , $tmp['Month']);
+    $smarty->assign("Weekdays", $tmp['Weekday']);
+
+    $smarty->assign("Expert"  , $this->Expert);
+
+    $smarty->assign("Actions"     , $this->Actions);
+    $smarty->assign("Target_list" , $divlist->DrawList());
+    return ($smarty->fetch (get_template_path('goto_task.tpl', TRUE)));
+  }
+
+
+  /* Map acl function, to be able to use plugin::save_object() */
+  function acl_is_writeable($str)
+  {
+    return($this->parent->acl_is_writeable($str));
+  }
+
+
+  function save_object()
+  {
+    if(isset($_POST['goto_task_posted'])){
+      plugin::save_object();
+
+      if(isset($_POST['ToggleExpertMode'])){
+        $this->Expert = !$this->Expert;
+      }
+    }
+  }  
+
+  
+  /* Check if given target is vald.
+   * It must either be a valid MAC address or an existing object group
+   */
+  function is_valid_target($str)
+  {
+    if(is_mac($str)){
+      return(TRUE);
+    }else{
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd($this->config->current['BASE']);
+      $ldap->search("(&(objectClassgosaGroupOfNames)(cn=".$str."))",array("cn"));
+      if($ldap->count()){
+        return(TRUE);
+      }
+    }
+  }
+
+
+  /* Return values for listboxes. 
+   */
+  function get_array_values()
+  {
+    $ret = array();    
+
+    /* Create minute array */
+    $Minute = array( "*"    => "*",
+                      "*/1"  => "*/1",
+                      "*/3"  => "*/3",
+                      "*/5"  => "*/5",
+                      "*/10" => "*/10",
+                      "*/15" => "*/15",
+                      "*/30" => "*/30",
+                      "*/45" => "*/45",
+                      "*/60" => "*/60"); 
+    for($i = 0; $i < 60 ; $i ++){
+      $Minute[$i] = $i;
+    }
+
+    /* Create hour array */
+    $Hour = array(   "*" => "*");
+    for($i = 1 ; $i < 24 ; $i ++ ){
+      $Hour["*/".$i] = "*/".$i;
+    } 
+    for($i = 0 ; $i < 24 ; $i ++ ){
+      $Hour[$i] = $i;
+    } 
+
+    /* Create hour array */
+    $Day = array( "*" => "*");
+    for($i = 1 ; $i < 32 ; $i ++ ){
+      $Day["*/".$i] = "*/".$i;
+    } 
+    for($i = 1 ; $i < 32 ; $i ++ ){
+      $Day[$i] = $i;
+    } 
+   
+    /* Create month array */
+    $Month = array( "*" => "*");
+    for($i = 1 ; $i <= 12 ; $i ++ ){
+      $Month["*/".$i] = "*/".$i;
+    } 
+    for($i = 1 ; $i <= 12 ; $i ++ ){
+      $Month[$i] = $i;
+    } 
+   
+    /* Create week day array */
+    $Weekday = array( "*" => "*");
+    for($i = 1 ; $i <= 7 ; $i ++ ){
+      $Weekday["*/".$i] = "*/".$i;
+    } 
+    for($i = 0 ; $i <= 7 ; $i ++ ){
+      $Weekday[$i] = $i;
+    } 
+   
+    foreach(array("Minute","Weekday","Hour","Day","Month") as $var){
+      $ret[$var] = $$var;
+    }
+    return($ret);
+  }
+}
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
index 8588da5cef03b24891cf00585fa2874216f39a7a..c81ec3bd032f08341892e4ccc2f47b5ad8e4819f 100644 (file)
@@ -52,7 +52,7 @@ class gotomasses extends plugin
     /* Edit selected entry */
     if($s_action == "edit" && isset($this->tasks[$s_entry])){
       $entry = $this->tasks[$s_entry];
-      $this->dialog = new goto_task($this->config,$entry);
+      $this->dialog = new goto_task($this->config,$this,$entry);
     }
   
     /* Close dialog */
@@ -61,7 +61,8 @@ class gotomasses extends plugin
     }
 
     /* Close dialog */
-    if(isset($_POST['close_goto_task'])){
+    if(isset($_POST['save_goto_task'])){
+      $this->dialog->save_object();
       $this->dialog = NULL;
     }
  
@@ -139,12 +140,7 @@ class gotomasses extends plugin
   {
     $ui = get_userinfo();
 
-    if(!$this->acl_is_readable("ACL missing")){
-      $this->tasks =array(); 
-      print_red(_("Your are not allowed to view contents of this plugin."));
-      return(FALSE);
-    }
-
+    
     if(!file_exists($this->file_to_read) || !is_readable($this->file_to_read)){
       print_red(sprintf(_("Can't locate or read csv storage file '%s'."),$this->file_to_read));
       return(FALSE);
@@ -232,6 +228,20 @@ class gotomasses extends plugin
   }
 
 
+  function get_actions()
+  {
+    /* Prepare list of available actions */
+    $actions = array( "reboot"          => _("Reboot"),
+                            "localboot"       => _("Localboot"),
+                            "halt"            => _("Halt system"),
+                            "update"          => _("Update"),
+                            "reinstall"       => _("(Re)Install"),
+                            "rescan"          => _("Rescan"),
+                            "memcheck"        => _("Memory check"));
+    return($actions);
+  }
+
+
   function plInfo()
   {
     return (array(
@@ -242,7 +252,14 @@ class gotomasses extends plugin
         "plPriority"    => 0,
         "plSection"     => array("addon"),
         "plCategory"    => array("gotomasses" => array("objectClass" => "none", "description" => _("System mass deployment"))),
-        "plProvidedAcls" => array()
+        "plProvidedAcls" => array("Comment"   => _("Description"), 
+                                  "Action"    => _("Action"),
+                                  "Day"       => _("Day"),
+                                  "Minute"    => _("Minute"),
+                                  "Hour"      => _("Hour"),
+                                  "Month"     => _("Month"),
+                                  "Weekday"   => _("Week day"),
+                                  "Target"    => _("Target"))
         ));
   }
 }
diff --git a/plugins/addons/gotomasses/class_target_list.inc b/plugins/addons/gotomasses/class_target_list.inc
new file mode 100644 (file)
index 0000000..bb91452
--- /dev/null
@@ -0,0 +1,268 @@
+<?php
+
+class target_list extends MultiSelectWindow
+{
+  var $config;
+  var $list         =array();
+  var $Targets_used =array();
+
+  /* Current base */
+  var $selectedBase       = "";
+  var $departments        = array();
+
+  /* Regex */
+  var $Regex              = "*";
+
+  /* CheckBoxes, to change default values modify $this->AddCheckBox */
+  var $ogroups        ;
+  var $servers        ;
+  var $workstations   ;
+
+
+  /* Subsearch checkbox */
+  var $SubSearch          ;
+  var $parent             ;
+  var $ui                 ;
+
+
+  
+  function target_list($config,$Targets_used)
+  {
+    MultiSelectWindow::MultiSelectWindow($config, "Targetselection", array("ogroup","gotomasses"));
+    
+    $this->SetInformation(  _("Select the target objects for your scheduled action."));
+    $this->SetTitle(        _("Available targets"));
+    $this->SetSummary(      _("Available targets"));
+    $this->SetHeadpageMode(FALSE);
+    
+    /* set Page header */
+    $chk = "<input type='checkbox' id='select_all' name='select_all'
+               onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
+    $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
+
+    $this->AddHeader(array("string" => "&nbsp;", "attach" => "style='text-align:center;width:20px;'"));
+    $this->AddHeader(array("string" => _("Object name"), "attach" => "style=''"));
+
+    /* Text ,Value, Name, Is selected */
+    $this->AddCheckBox("ogroups",       _("Select to see object groups"),  _("Show object object groups"), true);
+    $this->AddCheckBox("servers",       _("Select to see servers")  ,   _("Show servers"), true);
+    $this->AddCheckBox("workstations",  _("Select to see workstations"),_("Show workstations"), true);
+
+    /* Add SubSearch checkbox */
+    $this->AddCheckBox(SEPERATOR);
+    $this->AddCheckBox("SubSearch",  _("Select to search within subtrees"), _("Search in subtrees"), false);
+
+    /* Name,Text,Default  , Connect with alphabet  */
+    $this->AddRegex   ("Regex",     _("Regular expression for matching group names"), "*" , true);
+    $this->EnableAplhabet(TRUE);
+  }
+
+
+  function GenHeader()
+  {
+    $options= "";
+
+    /* Get all departments within this subtree */
+    $ui= get_userinfo();
+    $first = "";
+    $found = FALSE;
+    $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();
+    $tdeps= $ui->get_module_departments("ogroups");
+    $ids = $this->config->idepartments;
+    $first = "";
+    $found = FALSE;
+    foreach($ids as $dep => $name){
+      if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){
+
+        /* Keep first base dn in mind, we could need this
+         *  info if no valid base was found
+         */
+        if(empty($first)) {
+          $first = $dep['dn'];
+        }
+
+        $value = $ids[$dep];
+        if ($this->selectedBase == $dep){
+          $found = TRUE;
+          $options.= "<option selected='selected' value='".$dep."'>$value</option>";
+        } else {
+          $options.= "<option value='".$dep."'>$value</option>";
+        }
+      }
+    }
+
+    /* The currently used base is not visible with your acl setup.
+     * Set base to first useable base.
+     */
+    if(!$found){
+      $this->selectedBase = $first;
+    }
+
+    /* Get copy & paste icon */
+    $acls  = $ui->get_permissions($this->selectedBase,"ogroups/ogroup");
+    $acl_all= $ui->has_complete_category_acls($this->selectedBase,"ogroups");
+
+    /* Add default header */
+    $listhead = MultiSelectWindow::get_default_header();
+
+    /* Add department selector */
+    $listhead .= _("Base")."&nbsp;<select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
+      " <input class='center' type='image' src='images/list_submit.png' align='middle'
+      title='"._("Submit department")."' name='submit_department' alt='"._("Submit")."'>&nbsp;";
+    $listhead .="</div>";
+
+    $this->SetListHeader($listhead);
+  }
+
+
+  function execute()
+  {
+    $this->ClearElementsList();
+    $this->GenHeader();
+    $this->reload();
+    $this->SetEntries($this->list);
+    foreach($this->list as $key => $data){
+      
+    } 
+    return($this->Draw());
+  }
+
+  
+  function SetEntries($list)
+  {
+      /* Add Copy & Paste buttons if copy&paste is enabled
+     */
+    // Defining Links
+    $linkopen = "<a href='?plug=".$_GET['plug']."&amp;act=dep_open&amp;dep_id=%s'>%s</a>";
+    $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
+
+    $ui = get_userinfo();
+
+    // Assigning ogroups
+    foreach($list as $key => $val){
+
+      $title = "title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'";
+      if(!isset($val['description'][0])){
+        $desc = "";
+      }else{
+        $desc = " - [ ".$val['description'][0]." ]";
+      }
+
+      $img ="Hmm";
+      if(in_array("goServer",$val['objectClass'])){
+        $img = "<img src='images/select_server.png' alt='"._("Server")."' ".$title.">";
+      }elseif(in_array("gotoWorkstation",$val['objectClass'])){
+        $img = "<img src='images/select_workstation.png' alt='"._("Workstation")."' ".$title.">";
+      }elseif(in_array("gosaGroupOfNames",$val['objectClass'])){
+        $img = "<img src='images/list_ogroup.png' alt='"._("Object group")."' ".$title.">";
+      }
+
+      /* Create each field */
+      $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
+                      "attach" => "style='width:20px;'");
+      $field1 = array("string" => $img, 
+                      "attach" => "style='text-   align:center;width: 20px;'");
+      $field2 = array("string" => $val['cn'][0].$desc, 
+                      "attach" => "style='border-right:0px;' ".$title);
+
+      $this->AddElement(array($field0,$field1,$field2));
+    }
+  }
+
+  
+  function save()
+  { 
+    $ret = array();
+    $items = $this->list_get_selected_items();
+    foreach($items as $item){
+      $ret[] = $this->list[$item];
+    }
+    return($ret);
+  }
+
+
+  function save_object()
+  {
+    MultiSelectWindow::save_object();
+  }
+
+  
+  function reload()
+  {
+    /* Set base for all searches && initialise some vars */
+    $this->list= array();
+    $base     = $this->selectedBase;
+    $filter   = "";
+    $Regex    = $this->Regex;
+
+    $chk = array(
+        "ogroups"       => "(objectClass=gosaGroupOfNames)" ,
+        "servers"       => "(objectClass=goServer)" ,
+        "workstations"  => "(objectClass=gotoWorkstation)");
+
+    /* Create filter */
+    foreach($chk as $chkBox => $FilterPart){
+      if($this->$chkBox){
+        $filter .=  $FilterPart;
+      }
+    }
+    $filter= "(&(cn=".$Regex.")(|".$filter."))";
+
+    if($this->SubSearch){
+      $res= get_list($filter, array("ogroups","workstations","servers"), $base, 
+            array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
+    }else{
+      $res= get_list($filter, "ogroups", get_groups_ou().$base, 
+            array("cn","objectClass"), GL_SIZELIMIT );
+      $res= array_merge($res,get_list($filter, "workstation",  "ou=workstations,ou=systems,".$base, 
+            array("cn","objectClass"), GL_SIZELIMIT ));
+      $res= array_merge($res,get_list($filter, "server", "ou=servers,ou=systems,".$base, 
+            array("cn","objectClass"), GL_SIZELIMIT ));
+  
+    }
+
+    $this->list= $res;
+    ksort ($this->list);
+    reset ($this->list);
+    $tmp=array();
+    foreach($this->list as $tkey => $val ){
+      $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
+    }
+    ksort($tmp);
+    $this->list=array();
+    foreach($tmp as $val){
+      $this->list[]=$val;
+    }
+    reset ($this->list);
+  }
+
+  function list_get_selected_items()
+  {
+    $ids = array();
+    foreach($_POST as $name => $value){
+      if(preg_match("/^item_selected_[0-9]*$/",$name)){
+        $id   = preg_replace("/^item_selected_/","",$name);
+        $ids[$id] = $id;
+      }
+    }
+    return($ids);
+  }
+}
+
+
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+?>
diff --git a/plugins/addons/gotomasses/goto_task.tpl b/plugins/addons/gotomasses/goto_task.tpl
new file mode 100644 (file)
index 0000000..6988b0a
--- /dev/null
@@ -0,0 +1,174 @@
+<table style='width:100%;'>
+       <tr>
+               <td colspan="2">
+                       <h2>{t}Generic{/t}</h2>
+               </td>
+       </tr>
+       <tr>
+               <td style='width:50%;'>
+                       <table>
+                               <tr>
+                                       <td>
+                                               {t}Description{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$CommentACL}
+                                               <input type="text" name="Comment" value="{$Comment}">
+                                               {/render}
+                                       </td>
+                               </tr>
+                       </table>
+               </td>
+               <td>
+                       <table>
+                               <tr>
+                                       <td>
+                                               {t}Action{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$ActionACL}
+                                               <select name="Action">
+                                                       {html_options options=$Actions selected=$Action}
+                                               </select>
+                                               {/render}
+                                       </td>
+                               </tr>
+                       </table>
+
+               </td>
+       </tr>
+       <tr>
+               <td colspan="2">
+                       <h2>{t}Target systems{/t}</h2>
+               </td>
+       </tr>
+       <tr>
+               <td colspan="2">
+            <table  summary="" style="border:1px solid #B0B0B0; " cellspacing=0 cellpadding=0>
+                <tr>
+                    <td>
+                                               <div style='border-bottom: 1px solid #B0B0B0;'>
+                                               {render acl=$TargetACL}
+                                               {$Target_list}  
+                                               {/render}
+                                               </div>
+                                               {render acl=$TargetACL}
+                                               <input type="text" name="target_text" value="">
+                                               {/render}
+                                               {render acl=$TargetACL}
+                                               <input type="submit" name="add_target" value="{t}Add{/t}">
+                                               {/render}
+                                               {render acl=$TargetACL}
+                                               <input type="submit" name="add_from_list" value="{t}Add from list{/t}">
+                                               {/render}
+                                       </td>
+                               </tr>
+                       </table>
+
+               </td>
+       </tr>
+       <tr>
+               <td colspan="2">
+                       <h2>{t}Schedule{/t}</h2>
+               </td>
+       </tr>
+       <tr>
+               <td colspan="2">
+                       {if $Expert}
+                       <input type='submit' name='ToggleExpertMode' value="{t}Normal mode{/t}">
+                       <table>
+                               <tr>
+                                       <td style='width:20%;'>
+                                               {t}Minute{/t}&nbsp;
+                                               {render acl=$MinuteACL}
+                                               <input type='text' name='Minute' value="{$Minute}" style='width:50px;'>
+                                               {/render}
+                                       </td>
+                                       <td style='width:20%;'>
+                                               {render acl=$HourACL}
+                                               {t}Hour{/t}&nbsp;
+                                               <input type='text' name='Hour' value="{$Hour}" style='width:50px;'>
+                                               {/render}
+                                       </td>
+                                       <td style='width:20%;'>
+                                               {t}Day{/t}&nbsp;
+                                               {render acl=$DayACL}
+                                               <input type='text' name='Day' value="{$Day}" style='width:50px;'>
+                                               {/render}
+                                       </td>
+                                       <td style='width:20%;'>
+                                               {t}Month{/t}&nbsp;
+                                               {render acl=$MonthACL}
+                                               <input type='text' name='Month' value="{$Month}" style='width:50px;'>
+                                               {/render}
+                                       </td>
+                                       <td style='width:20%;'>
+                                               {t}Week day{/t}&nbsp;
+                                               {render acl=$WeekdayACL}
+                                               <input type='text' name='Weekday' value="{$Weekday}" style='width:50px;'>
+                                               {/render}
+                                       </td>
+                               </tr>
+                       </table>
+                       {else}
+
+                       <input type='submit' name='ToggleExpertMode' value="{t}Expert mode{/t}">
+                       <table>
+                               <tr>
+                                       <td>{t}Minute{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$MinuteACL}
+                                               <select name='Minute'>
+                                                       {html_options options=$Minutes selected=$Minute}
+                                               </select>
+                                               {/render}
+                                       </td>
+                                       <td>{t}Hour{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$HourACL}
+                                               <select name='Hour'>
+                                                       {html_options options=$Hours selected=$Hour}
+                                               </select>
+                                               {/render}
+                                       </td>
+                                       <td>{t}Day{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$DayACL}
+                                               <select name='Day'>
+                                                       {html_options options=$Days selected=$Day}
+                                               </select>
+                                               {/render}
+                                       </td>
+                                       <td>{t}Month{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$MonthACL}
+                                               <select name='Month'>
+                                                       {html_options options=$Months selected=$Month}
+                                               </select>
+                                               {/render}
+                                       </td>
+                                       <td>{t}Week day{/t}
+                                       </td>
+                                       <td>
+                                               {render acl=$WeekdayACL}
+                                               <select name='Weekday'>
+                                                       {html_options options=$Weekdays selected=$Weekday}
+                                               </select>
+                                               {/render}
+                                       </td>
+                               </tr>
+                       </table>
+                       {/if}
+       
+               </td>
+       </tr>
+</table>
+<input type='hidden' name='goto_task_posted' value='1'>
+<p style="text-align:right">
+       <input type='submit' name='close_goto_task' value='{t}Cancel{/t}'>
+       <input type='submit' name='save_goto_task' value='{t}Apply{/t}'>
+</p>