r56086 - in /trunk/admin: inc/ templates/default/

classic Classic list List threaded Threaded
1 message Options
ralfbecker_sf ralfbecker_sf
Reply | Threaded
Open this post in threaded view
|

r56086 - in /trunk/admin: inc/ templates/default/

Author: ralfbecker
Date: Sat May  7 18:57:18 2016
New Revision: 56086

URL: http://svn.stylite.de/viewvc/egroupware?rev=56086&view=rev
Log:
port "Admin Queue and History" and "Remote Administration Instances" to eT2

Modified:
    trunk/admin/inc/class.admin_cmds.inc.php
    trunk/admin/inc/class.admin_hooks.inc.php
    trunk/admin/templates/default/cmds.xet
    trunk/admin/templates/default/remotes.xet

Modified: trunk/admin/inc/class.admin_cmds.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/inc/class.admin_cmds.inc.php?rev=56086&r1=56085&r2=56086&view=diff
==============================================================================
--- trunk/admin/inc/class.admin_cmds.inc.php (original)
+++ trunk/admin/inc/class.admin_cmds.inc.php Sat May  7 18:57:18 2016
@@ -11,6 +11,7 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Etemplate;
 
 /**
  * UI for the admin comand queue
@@ -47,7 +48,13 @@
  catch (Exception $e) {
  $row['title'] = $e->getMessage();
  }
- $readonlys["delete[$row[id]]"] = $row['status'] != admin_cmd::scheduled;
+ $row['data'] = !($data = json_php_unserialize($row['data'])) ? '' :
+ json_encode($data, JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
+
+ if ($row['status'] == admin_cmd::scheduled)
+ {
+ $row['class'] = 'AllowDelete';
+ }
  }
  //_debug_array($rows);
  return $total;
@@ -60,7 +67,7 @@
  */
  static function index(array $content=null)
  {
- $tpl = new etemplate('admin.cmds');
+ $tpl = new Etemplate('admin.cmds');
 
  if (!is_array($content))
  {
@@ -74,6 +81,9 @@
  'no_cat' => true, // I  disable the cat-selectbox
  'order' => 'cmd_created',
  'sort' => 'DESC',
+ 'row_id' => 'id',
+ 'default_cols' => 'title,created,creator,status',
+ 'actions' => self::cmd_actions(),
  );
  }
  }
@@ -95,6 +105,21 @@
  }
 
  /**
+ * Acctions for command list/index
+ *
+ * As we only allow to delete scheduled command, which we currently can only create via admin-cli,
+ * I have not (yet) implemented delete of scheduled commands.
+ *
+ * @return array
+ */
+ static function cmd_actions()
+ {
+ return array(
+
+ );
+ }
+
+ /**
  * get_rows for remote instances
  *
  * @param array $query
@@ -114,7 +139,7 @@
  */
  static function remotes(array $content=null)
  {
- $tpl = new etemplate('admin.remotes');
+ $tpl = new Etemplate('admin.remotes');
 
  if (!is_array($content))
  {
@@ -128,7 +153,8 @@
  'no_cat' => true, // I  disable the cat-selectbox
  'order' => 'remote_name',
  'sort' => 'ASC',
- 'header_right' => 'admin.remotes.header_right',
+ 'row_id' => 'remote_id',
+ 'actions' => self::remote_actions(),
  );
  }
  }
@@ -137,12 +163,17 @@
  //_debug_array($content);
  unset($content['msg']);
 
- if ($content['nm']['rows']['edit'])
- {
- list($id) = each($content['nm']['rows']['edit']);
- unset($content['nm']['rows']);
-
- $content['remote'] = admin_cmd::read_remote($id);
+ if ($content['nm']['action'])
+ {
+ switch($content['nm']['action'])
+ {
+ case 'edit':
+ $content['remote'] = admin_cmd::read_remote($content['nm']['selected'][0]);
+ break;
+ case 'add':
+ $content['remote'] = array('remote_domain' => 'default');
+ }
+ unset($content['nm']['action']);
  }
  elseif($content['remote']['button'])
  {
@@ -180,6 +211,34 @@
  }
  }
  $tpl->exec('admin.admin_cmds.remotes',$content,array(),array(),$content);
-
+ }
+
+ /**
+ * Actions for remotes list
+ *
+ * @return array
+ */
+ static function remote_actions()
+ {
+ return array(
+ 'edit' => array(
+ 'caption' => 'Edit',
+ 'default' => true,
+ 'allowOnMultiple' => false,
+ 'nm_action' => 'submit',
+ 'group' => $group=0,
+ ),
+ 'add' => array(
+ 'caption' => 'Add',
+ 'nm_action' => 'submit',
+ 'group' => ++$group,
+ ),
+ /* not (yet) implemented
+ 'delete' => array(
+ 'caption' => 'Delete',
+ 'nm_action' => 'submit',
+ 'group' => ++$group,
+ ),*/
+ );
  }
 }

Modified: trunk/admin/inc/class.admin_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/inc/class.admin_hooks.inc.php?rev=56086&r1=56085&r2=56086&view=diff
==============================================================================
--- trunk/admin/inc/class.admin_hooks.inc.php (original)
+++ trunk/admin/inc/class.admin_hooks.inc.php Sat May  7 18:57:18 2016
@@ -133,8 +133,8 @@
  {
  $file['phpInfo']         = "javascript:egw.openPopup('" . Egw::link('/admin/phpinfo.php','',false) . "',960,600,'phpinfoWindow')";
  }
- $file['Admin queue and history'] = Egw::link('/index.php','menuaction=admin.admin_cmds.index');
- $file['Remote administration instances'] = Egw::link('/index.php','menuaction=admin.admin_cmds.remotes');
+ $file['Admin queue and history'] = Egw::link('/index.php','menuaction=admin.admin_cmds.index&ajax=true');
+ $file['Remote administration instances'] = Egw::link('/index.php','menuaction=admin.admin_cmds.remotes&ajax=true');
  $file['Custom translation'] = Egw::link('/index.php','menuaction=admin.admin_customtranslation.index');
  $file['Changelog and versions'] = Egw::link('/about.php');
 

Modified: trunk/admin/templates/default/cmds.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/default/cmds.xet?rev=56086&r1=56085&r2=56086&view=diff
==============================================================================
--- trunk/admin/templates/default/cmds.xet (original)
+++ trunk/admin/templates/default/cmds.xet Sat May  7 18:57:18 2016
@@ -5,14 +5,13 @@
  <template id="admin.cmds.rows" template="" lang="" group="0" version="1.5.001">
  <grid width="100%">
  <columns>
+ <column width="30%" minWidth="300"/>
  <column/>
  <column/>
  <column/>
- <column/>
- <column/>
- <column/>
- <column/>
- <column/>
+ <column width="120"/>
+ <column width="120"/>
+ <column width="30%" minWidth="120"/>
  <column/>
  <column/>
  </columns>
@@ -20,33 +19,27 @@
  <row class="th">
  <nextmatch-header label="Title" id="title"/>
  <nextmatch-header label="Requested" id="requested"/>
- <nextmatch-sortheader label="Scheduled" id="cmd_scheduled"/>
+ <nextmatch-sortheader label="Scheduled" id="scheduled"/>
  <nextmatch-filterheader options="Remote" id="remote_id"/>
- <nextmatch-sortheader label="Created" id="cmd_created"/>
- <nextmatch-accountfilter id="creator" options="Creator"/>
- <nextmatch-filterheader id="status" options="Status"/>
- <nextmatch-sortheader label="Modified" id="cmd_modified"/>
+ <nextmatch-sortheader label="Created" id="created"/>
+ <nextmatch-accountfilter empty_label="Creator" id="creator"/>
+ <nextmatch-filterheader empty_label="Status" id="status"/>
+ <nextmatch-sortheader label="Modified" id="modified"/>
  <nextmatch-accountfilter options="Modifier" id="modifier"/>
- <description/>
  </row>
- <row class="row" disabled="!@1">
- <description id="${row}[title]"/>
+ <row class="row $row_cont[class]">
+ <description id="${row}[title]" statustext="$row_cont[data]"/>
  <url-email id="${row}[requested]" options=",,,$row_cont[requested_email]" readonly="true"/>
  <date-time id="${row}[scheduled]" readonly="true"/>
- <menulist>
- <menupopup id="${row}[remote_id]" readonly="true"/>
- </menulist>
+ <select id="${row}[remote_id]" readonly="true"/>
  <date-time id="${row}[created]" readonly="true"/>
- <url-email id="${row}[creator]" options=",,,$row_cont[creator_email]" readonly="true"/>
- <vbox options="0,0">
- <menulist>
- <menupopup id="${row}[status]" readonly="true"/>
- </menulist>
+ <select-account id="${row}[creator]" readonly="true" statustext="$row_cont[creator_email]"/>
+ <vbox>
+ <select id="${row}[status]" readonly="true"/>
  <description id="${row}[error]" class="redItalic"/>
  </vbox>
  <date-time id="${row}[modified]" readonly="true"/>
- <url-email id="${row}[modifier]" readonly="true" options=",,,$row_cont[modifier_email]"/>
- <button image="delete" label="Cancel" id="delete[$row_cont[id]]" statustext="Cancel this scheduled command" onclick="et2_dialog.confirm(widget,'Cancel this scheduled command','Cancel');"/>
+ <select-account id="${row}[modifier]" readonly="true" statustext="$row_cont[modifier_email]"/>
  </row>
  </rows>
  </grid>

Modified: trunk/admin/templates/default/remotes.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/templates/default/remotes.xet?rev=56086&r1=56085&r2=56086&view=diff
==============================================================================
--- trunk/admin/templates/default/remotes.xet (original)
+++ trunk/admin/templates/default/remotes.xet Sat May  7 18:57:18 2016
@@ -41,19 +41,15 @@
  <hbox span="all">
  <button label="Save" id="button[save]" statustext="Saves this entry"/>
  <button id="button[apply]" label="Apply" statustext="Apply the changes"/>
- <button label="Cancel" id="button[cancel]" statustext="leave without saveing the entry"/>
+ <button label="Cancel" id="button[cancel]" statustext="leave without saveing the entry" novalidate="true"/>
  </hbox>
  </row>
  </rows>
  </grid>
  </template>
- <template id="admin.remotes.header_right" template="" lang="" group="0" version="1.5.001">
- <button rows="1" cols="1" id="add" label="Add" statustext="Add a new remote instance"/>
- </template>
  <template id="admin.remotes.rows" template="" lang="" group="0" version="1.5.001">
  <grid>
  <columns>
- <column/>
  <column/>
  <column/>
  <column/>
@@ -63,18 +59,17 @@
  <nextmatch-sortheader label="Name" id="remote_name"/>
  <nextmatch-sortheader label="URL" id="remote_url"/>
  <nextmatch-sortheader label="Instance" id="remote_domain"/>
- <description value="Actions"/>
  </row>
  <row class="row">
  <description id="${row}[remote_name]"/>
  <description options=",$row_cont[remote_url]/?domain=$row_cont[remote_domain],,,_blank" id="${row}[remote_url]"/>
  <description id="${row}[remote_domain]" no_lang="1"/>
- <hbox align="center">
- <button image="edit" label="Edit" id="edit[$row_cont[remote_id]]"/>
- </hbox>
  </row>
  </rows>
  </grid>
+ </template>
+ <template id="admin.remotes.header_left" template="" lang="" group="0" version="1.5.001">
+ <button id="add" label="Add" statustext="Add a new remote instance"/>
  </template>
  <template id="admin.remotes" template="" lang="" group="0" version="1.5.001">
  <grid width="100%">
@@ -82,17 +77,11 @@
  <column/>
  </columns>
  <rows>
- <row disabled="!@msg">
- <description span="all" class="redItalic" id="msg"/>
- </row>
  <row disabled="!@remote">
  <template content="remote" span="all" class="border" id="admin.remotes.edit"/>
  </row>
- <row disabled="1">
- <template align="right" id="admin.remotes.header_right"/>
- </row>
  <row>
- <nextmatch id="nm" options="admin.remotes.rows"/>
+ <nextmatch id="nm" options="admin.remotes.rows" header_left="admin.remotes.header_left"/>
  </row>
  </rows>
  </grid>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
eGroupWare-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs