get delete in CRM view working by submitting it back to server

This commit is contained in:
Ralf Becker 2014-03-10 21:15:23 +00:00
parent 7bda46582d
commit 30bf1aa439
2 changed files with 13 additions and 6 deletions

View File

@ -2115,12 +2115,17 @@ window.egw_LAB.wait(function() {
egw_json_response::get()->data($ret); egw_json_response::get()->data($ret);
} }
function view($content=null) /**
* CRM view
*
* @param array $content
*/
function view(array $content=null)
{ {
if(is_array($content)) if(is_array($content))
{ {
list($button) = each($content['button']); list($button) = each($content['button']);
switch ($button) switch ($content['toolbar'] ? $content['toolbar'] : $button)
{ {
case 'vcard': case 'vcard':
egw::redirect_link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$content['id']); egw::redirect_link('/index.php','menuaction=addressbook.uivcard.out&ab_id=' .$content['id']);
@ -2151,7 +2156,7 @@ window.egw_LAB.wait(function() {
// make everything not explicit mentioned readonly // make everything not explicit mentioned readonly
$readonlys['__ALL__'] = true; $readonlys['__ALL__'] = true;
$readonlys['photo'] = $readonlys['button[cancel]'] = $readonlys['button[copy]'] = $readonlys['photo'] = $readonlys['button[cancel]'] = $readonlys['button[copy]'] =
$readonlys['button[ok]'] = $readonlys['button[more]'] = false; $readonlys['button[ok]'] = $readonlys['button[more]'] = $readonlys['toolbar'] = false;
foreach(array_keys($this->contact_fields) as $key) foreach(array_keys($this->contact_fields) as $key)
{ {
@ -2245,6 +2250,9 @@ window.egw_LAB.wait(function() {
// load app.css for addressbook explicit, as addressbook_view hooks changes currentapp! // load app.css for addressbook explicit, as addressbook_view hooks changes currentapp!
egw_framework::includeCSS('addressbook', 'app'); egw_framework::includeCSS('addressbook', 'app');
// dont show an app-header
$GLOBALS['egw_info']['flags']['app_header'] = '';
$this->tmpl->setElementAttribute('toolbar', 'actions', array( $this->tmpl->setElementAttribute('toolbar', 'actions', array(
'edit' => array( 'edit' => array(
'caption' => 'Edit', 'caption' => 'Edit',

View File

@ -102,11 +102,10 @@ app.classes.addressbook = AppJS.extend(
this.egw.open(id, 'addressbook', 'edit', { makecp: 1}); this.egw.open(id, 'addressbook', 'edit', { makecp: 1});
break; break;
case 'cancel': case 'cancel':
default:
this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook'); this.egw.open(null, 'addressbook', 'list', null, '_self', 'addressbook');
break; break;
//default: default: // submit all other buttons back to server
this.et2._inst.template.submit(_action.id); this.et2._inst.submit();
break; break;
} }
}, },