only show view icon, if no edit rights (both opening the edit dialog now)

This commit is contained in:
Ralf Becker 2007-01-02 14:55:24 +00:00
parent 1925d9669d
commit 3c6bc0fd53
3 changed files with 6 additions and 5 deletions

View File

@ -203,9 +203,8 @@ class uilist extends uical
$rows = array(); $rows = array();
foreach((array) $this->bo->search($search_params) as $event) foreach((array) $this->bo->search($search_params) as $event)
{ {
$readonlys['edit['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_EDIT,$event); $readonlys['view['.$event['id'].']'] = !($readonlys['edit['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_EDIT,$event));
$readonlys['delete['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_DELETE,$event); $readonlys['delete['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_DELETE,$event);
$readonlys['view['.$event['id'].']'] = !$this->bo->check_perms(EGW_ACL_READ,$event);
$event['parts'] = implode(",\n",$this->bo->participants($event)); $event['parts'] = implode(",\n",$this->bo->participants($event));
$event['recure'] = $this->bo->recure2string($event); $event['recure'] = $this->bo->recure2string($event);

View File

@ -2,7 +2,7 @@
/** /**
* eGroupWare - eTemplates for Application calendar * eGroupWare - eTemplates for Application calendar
* http://www.egroupware.org * http://www.egroupware.org
* generated by soetemplate::dump4setup() 2006-12-27 13:51 * generated by soetemplate::dump4setup() 2007-01-02 15:54
* *
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package calendar * @package calendar
@ -73,3 +73,5 @@ $templ_data[] = array('name' => 'calendar.list.rows','template' => '','lang' =>
$templ_data[] = array('name' => 'calendar.list.rows','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:4:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";s:1:"B";s:3:"40%";s:1:"E";s:3:"10%";}i:1;a:5:{s:1:"A";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Start";s:4:"name";s:9:"cal_start";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:7:"cal_end";s:5:"label";s:3:"End";}}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Title";s:4:"name";s:9:"cal_title";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Description";s:4:"name";s:15:"cal_description";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:9:"cal_owner";s:5:"label";s:5:"Owner";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:12:"cal_location";s:5:"label";s:8:"Location";}}s:1:"D";a:3:{s:4:"size";s:16:"All participants";s:4:"name";s:11:"participant";s:4:"type";s:23:"nextmatch-accountfilter";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";s:4:"span";s:8:",noPrint";}}i:2;a:5:{s:1:"A";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:13:"${row}[start]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:11:"${row}[end]";s:8:"readonly";s:1:"1";}s:4:"name";s:5:"start";}s:1:"B";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:5:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[title]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"b";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[description]";s:7:"no_lang";s:1:"1";}i:3;a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[recure]";s:7:"no_lang";s:1:"1";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[location]";s:7:"no_lang";s:1:"1";}}s:1:"D";a:4:{s:4:"type";s:4:"html";s:4:"name";s:13:"${row}[parts]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"E";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"view";s:5:"label";s:4:"view";s:4:"name";s:19:"view[$row_cont[id]]";s:4:"help";s:15:"View this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.view&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:2;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:19:"edit[$row_cont[id]]";s:4:"help";s:15:"Edit this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.edit&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:3;a:6:{s:4:"type";s:6:"button";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:17:"Delete this event";s:7:"onclick";s:36:"return confirm(\'Delete this event\');";}s:4:"span";s:8:",noPrint";}}}s:4:"rows";i:2;s:4:"cols";i:5;s:7:"options";a:0:{}s:4:"size";s:4:"100%";}}','size' => '100%','style' => '','modified' => '1128457387',); $templ_data[] = array('name' => 'calendar.list.rows','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:4:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";s:1:"B";s:3:"40%";s:1:"E";s:3:"10%";}i:1;a:5:{s:1:"A";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Start";s:4:"name";s:9:"cal_start";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:7:"cal_end";s:5:"label";s:3:"End";}}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Title";s:4:"name";s:9:"cal_title";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Description";s:4:"name";s:15:"cal_description";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:9:"cal_owner";s:5:"label";s:5:"Owner";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:12:"cal_location";s:5:"label";s:8:"Location";}}s:1:"D";a:3:{s:4:"size";s:16:"All participants";s:4:"name";s:11:"participant";s:4:"type";s:23:"nextmatch-accountfilter";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";s:4:"span";s:8:",noPrint";}}i:2;a:5:{s:1:"A";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:13:"${row}[start]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:11:"${row}[end]";s:8:"readonly";s:1:"1";}s:4:"name";s:5:"start";}s:1:"B";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:5:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[title]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"b";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[description]";s:7:"no_lang";s:1:"1";}i:3;a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[recure]";s:7:"no_lang";s:1:"1";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[location]";s:7:"no_lang";s:1:"1";}}s:1:"D";a:4:{s:4:"type";s:4:"html";s:4:"name";s:13:"${row}[parts]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"E";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"view";s:5:"label";s:4:"view";s:4:"name";s:19:"view[$row_cont[id]]";s:4:"help";s:15:"View this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.view&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:2;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:19:"edit[$row_cont[id]]";s:4:"help";s:15:"Edit this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.edit&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:3;a:6:{s:4:"type";s:6:"button";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:17:"Delete this event";s:7:"onclick";s:36:"return confirm(\'Delete this event\');";}s:4:"span";s:8:",noPrint";}}}s:4:"rows";i:2;s:4:"cols";i:5;s:7:"options";a:0:{}s:4:"size";s:4:"100%";}}','size' => '100%','style' => '','modified' => '1128457387',);
$templ_data[] = array('name' => 'calendar.list.rows','template' => '','lang' => '','group' => '0','version' => '1.3.002','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:4:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";s:1:"B";s:3:"40%";s:1:"E";s:3:"10%";}i:1;a:5:{s:1:"A";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Start";s:4:"name";s:9:"cal_start";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:7:"cal_end";s:5:"label";s:3:"End";}}s:1:"B";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:5:"Title";s:4:"name";s:9:"cal_title";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:11:"Description";s:4:"name";s:15:"cal_description";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:9:"cal_owner";s:5:"label";s:5:"Owner";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:4:"name";s:12:"cal_location";s:5:"label";s:8:"Location";}}s:1:"D";a:3:{s:4:"size";s:16:"All participants";s:4:"name";s:11:"participant";s:4:"type";s:23:"nextmatch-accountfilter";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:5:"label";s:7:"Actions";s:4:"span";s:8:",noPrint";}}i:2;a:5:{s:1:"A";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:13:"${row}[start]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:11:"${row}[end]";s:8:"readonly";s:1:"1";}s:4:"name";s:5:"start";}s:1:"B";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:5:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[title]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";s:4:"size";s:1:"b";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:19:"${row}[description]";s:7:"no_lang";s:1:"1";}i:3;a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[recure]";s:7:"no_lang";s:1:"1";}}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"name";s:16:"${row}[location]";s:7:"no_lang";s:1:"1";}}s:1:"D";a:4:{s:4:"type";s:4:"html";s:4:"name";s:13:"${row}[parts]";s:8:"readonly";s:1:"1";s:7:"no_lang";s:1:"1";}s:1:"E";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";i:1;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"view";s:5:"label";s:4:"View";s:4:"name";s:19:"view[$row_cont[id]]";s:4:"help";s:15:"View this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.edit&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:2;a:6:{s:4:"type";s:6:"button";s:4:"size";s:4:"edit";s:5:"label";s:4:"Edit";s:4:"name";s:19:"edit[$row_cont[id]]";s:4:"help";s:15:"Edit this event";s:7:"onclick";s:197:"window.open(egw::link(\'/index.php\',\'menuaction=calendar.uiforms.edit&cal_id=$row_cont[id]&date=$row_cont[date]\'),\'425\',\'dependent=yes,width=750,height=450,scrollbars=yes,status=yes\'); return false;";}i:3;a:6:{s:4:"type";s:6:"button";s:4:"name";s:21:"delete[$row_cont[id]]";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:4:"help";s:17:"Delete this event";s:7:"onclick";s:36:"return confirm(\'Delete this event\');";}s:4:"span";s:8:",noPrint";}}}s:4:"rows";i:2;s:4:"cols";i:5;s:7:"options";a:0:{}s:4:"size";s:4:"100%";}}','size' => '100%','style' => '','modified' => '1128457387',);

View File

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- $Id$ --> <!-- $Id$ -->
<overlay> <overlay>
<template id="calendar.list.rows" template="" lang="" group="0" version="1.3.001"> <template id="calendar.list.rows" template="" lang="" group="0" version="1.3.002">
<grid width="100%"> <grid width="100%">
<columns> <columns>
<column/> <column/>
@ -45,7 +45,7 @@
</vbox> </vbox>
<html id="${row}[parts]" readonly="true" no_lang="1"/> <html id="${row}[parts]" readonly="true" no_lang="1"/>
<hbox class="noPrint"> <hbox class="noPrint">
<button image="view" label="view" id="view[$row_cont[id]]" statustext="View this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.view&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/> <button image="view" label="View" id="view[$row_cont[id]]" statustext="View this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button image="edit" label="Edit" id="edit[$row_cont[id]]" statustext="Edit this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/> <button image="edit" label="Edit" id="edit[$row_cont[id]]" statustext="Edit this event" onclick="window.open(egw::link('/index.php','menuaction=calendar.uiforms.edit&amp;cal_id=$row_cont[id]&amp;date=$row_cont[date]'),'425','dependent=yes,width=750,height=450,scrollbars=yes,status=yes'); return false;"/>
<button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this event" onclick="return confirm('Delete this event');"/> <button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this event" onclick="return confirm('Delete this event');"/>
</hbox> </hbox>