mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
finished work on accessories
This commit is contained in:
parent
b2e1f40eb3
commit
b5bcc312fb
@ -205,7 +205,7 @@ class bo_resources
|
|||||||
{
|
{
|
||||||
$this->remove_picture($id);
|
$this->remove_picture($id);
|
||||||
$this->link->unlink(0,'resources',$id);
|
$this->link->unlink(0,'resources',$id);
|
||||||
return $this->so->delete(array('id'=>$id)) ? false : lang('Something went wrong by saving resource');
|
return $this->so->delete(array('id'=>$id)) ? false : lang('Something went wrong by deleting resource');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -220,14 +220,11 @@ class bo_resources
|
|||||||
if($id < 1){return;}
|
if($id < 1){return;}
|
||||||
$cat_id = $this->so->get_value('cat_id',$id);
|
$cat_id = $this->so->get_value('cat_id',$id);
|
||||||
$data[0] = array('id' => '', 'name' => '');
|
$data[0] = array('id' => '', 'name' => '');
|
||||||
$this->so->search(array('accessory_only' => 1),array($cat_id => ''),&$data,$accessory_of=-1,$order_by='',$offset=false,$num_rows=-1);
|
$this->so->search(array('name' => '*'),array($cat_id => ''),&$data,$accessory_of=$id,$order_by='',$offset=false,$num_rows=-1);
|
||||||
foreach($data as $num => $resource)
|
foreach($data as $num => $resource)
|
||||||
{
|
|
||||||
if($num != 0)
|
|
||||||
{
|
{
|
||||||
$acc_list[$resource['id']] = $resource['name'];
|
$acc_list[$resource['id']] = $resource['name'];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return $acc_list;
|
return $acc_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ class ui_resources
|
|||||||
var $public_functions = array(
|
var $public_functions = array(
|
||||||
'index' => True,
|
'index' => True,
|
||||||
'edit' => True,
|
'edit' => True,
|
||||||
|
'show' => True,
|
||||||
|
'admin' => True,
|
||||||
'writeLangFile' => True
|
'writeLangFile' => True
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ class ui_resources
|
|||||||
return $this->delete($id);
|
return $this->delete($id);
|
||||||
case 'new_acc':
|
case 'new_acc':
|
||||||
list($id) = each($content['nm']['rows']['new_acc']);
|
list($id) = each($content['nm']['rows']['new_acc']);
|
||||||
return $this->edit(array('resource_id' => 0, 'accessory_of' => $id));
|
return $this->edit(array('id' => 0, 'accessory_of' => $id));
|
||||||
case 'view_acc':
|
case 'view_acc':
|
||||||
list($id) = each($content['nm']['rows']['view_acc']);
|
list($id) = each($content['nm']['rows']['view_acc']);
|
||||||
$content['view_accs_of'] = $id;
|
$content['view_accs_of'] = $id;
|
||||||
@ -74,7 +76,7 @@ class ui_resources
|
|||||||
}
|
}
|
||||||
if (isset($content['add']))
|
if (isset($content['add']))
|
||||||
{
|
{
|
||||||
return $this->edit(0);
|
return $content['view_accs_of'] ? $this->edit(array('id' => 0, 'accessory_of' => $id)) : $this->edit(0);
|
||||||
}
|
}
|
||||||
if (isset($content['back']))
|
if (isset($content['back']))
|
||||||
{
|
{
|
||||||
@ -106,9 +108,9 @@ class ui_resources
|
|||||||
$content['nm']['no_filter'] = true;
|
$content['nm']['no_filter'] = true;
|
||||||
$content['nm']['no_filter2'] = true;
|
$content['nm']['no_filter2'] = true;
|
||||||
$content['nm']['view_accs_of'] = $content['view_accs_of'];
|
$content['nm']['view_accs_of'] = $content['view_accs_of'];
|
||||||
$no_button['add'] = true;
|
|
||||||
$no_button['back'] = false;
|
$no_button['back'] = false;
|
||||||
}
|
}
|
||||||
|
$preserv = $content;
|
||||||
$this->tmpl->exec('resources.ui_resources.index',$content,$sel_options,$no_button,$preserv);
|
$this->tmpl->exec('resources.ui_resources.index',$content,$sel_options,$no_button,$preserv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +142,7 @@ class ui_resources
|
|||||||
unset($content['delete']);
|
unset($content['delete']);
|
||||||
$content['msg'] = $this->delete($content['id']);
|
$content['msg'] = $this->delete($content['id']);
|
||||||
}
|
}
|
||||||
return $content['msg'] ? $this->edit($content) : $this->index();
|
return $content['msg'] ? $this->edit($content) : $content['accessory_of'] ? $this->index(array('view_accs_of' => $content['accessory_of'])) : $this->index();
|
||||||
}
|
}
|
||||||
elseif($content['cancel'])
|
elseif($content['cancel'])
|
||||||
{
|
{
|
||||||
@ -149,23 +151,23 @@ class ui_resources
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$resource_id = $content;
|
$id = $content;
|
||||||
$content = array('resource_id' => $resource_id);
|
$content = array('id' => $id);
|
||||||
|
|
||||||
if ($resource_id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
$content = $this->bo->read($resource_id);
|
$content = $this->bo->read($id);
|
||||||
$content['gen_src_list'] = strstr($content['picture_src'],'.') ? $content['picture_src'] : false;
|
$content['gen_src_list'] = strstr($content['picture_src'],'.') ? $content['picture_src'] : false;
|
||||||
$content['picture_src'] = strstr($content['picture_src'],'.') ? 'gen_src' : $content['picture_src'];
|
$content['picture_src'] = strstr($content['picture_src'],'.') ? 'gen_src' : $content['picture_src'];
|
||||||
$content['link_to'] = array(
|
$content['link_to'] = array(
|
||||||
'to_id' => $resource_id,
|
'to_id' => $id,
|
||||||
'to_app' => 'resources'
|
'to_app' => 'resources'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// some presetes
|
// some presetes
|
||||||
$content['resource_picture'] = $this->bo->get_picture($content['resource_id'],$content['picture_src'],$size=true);
|
$content['resource_picture'] = $this->bo->get_picture($content['id'],$content['picture_src'],$size=true);
|
||||||
$content['accessory_of'] = $content['accessory_of'] ? $content['accessory_of'] : -1;
|
$content['accessory_of'] = $content['accessory_of'] ? $content['accessory_of'] : -1;
|
||||||
$content['quantity'] = $content['quantity'] ? $content['quantity'] : 1;
|
$content['quantity'] = $content['quantity'] ? $content['quantity'] : 1;
|
||||||
$content['useable'] = $content['useable'] ? $content['useable'] : 1;
|
$content['useable'] = $content['useable'] ? $content['useable'] : 1;
|
||||||
@ -199,7 +201,6 @@ class ui_resources
|
|||||||
|
|
||||||
function delete($id)
|
function delete($id)
|
||||||
{
|
{
|
||||||
// Wollen sie Dieses bla bla wirklich löschen --> ja (Wie bekommt man mit eTemplate ein Javascript Dialog???)
|
|
||||||
$this->bo->delete($id);
|
$this->bo->delete($id);
|
||||||
return $this->index();
|
return $this->index();
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user