work on picture upload

This commit is contained in:
Cornelius Weiß 2005-02-12 08:25:26 +00:00
parent 4d498d47cb
commit 77a51bc6ab
6 changed files with 99 additions and 35 deletions

View File

@ -86,9 +86,41 @@ class bo_resources
return /* all exept pictures(blobs) */$this->so->read($id);
}
function save($content)
/*!
@function save
@abstract saves a resource including picture upload ...
@param array $resource array with key => value of all needed datas
@return string msg if somthing went wrong
*/
function save($resource)
{
return $this->so->save_data($content);
if($resource['own_file']['size']>0 && ($resource['picture_src']=='db_src' || sizeof($resource['picture_src'])<1))
{
$resource['picture_src'] = 'db_src';
switch($resource['own_file']['type'])
{
case 'image/gif':
$resource['db_src'] = imagecreatefromgif($resource['own_file']['tmp_name']);
break;
case 'image/jpeg':
case 'image/pjpeg':
$resource['db_src'] = imagecreatefromjpeg($resource['own_file']['tmp_name']);
break;
case 'image/png':
case 'image/x-png':
$resource['db_src'] = imagecreatefrompng($resource['own_file']['tmp_name']);
break;
default:
return 'Picture type is not supported, sorry!';
}
}
if($resource['picture_src'] == 'gen_src')
{
}
return $this->so->save_data($resource);
}
function delete($id)
@ -97,7 +129,7 @@ class bo_resources
}
function get_images($params)
{
{
$id = implode($params);
$picture = $this->so->get_value('picture',$id);
if($picture)
@ -107,7 +139,7 @@ class bo_resources
echo $picture;
}
header('Content-type: image/png');
echo file_get_contents(PHPGW_INCLUDE_ROOT.'/contactcenter/templates/default/images/photo.png');
echo file_get_contents(PHPGW_INCLUDE_ROOT.'/resources/templates/default/images/generic.png');
return;
}
}

View File

@ -93,6 +93,9 @@ class ui_resources
*/
function edit($content='',$msg='')
{
$sel_options = array('cat_id' => $this->bo->acl->get_cats(PHPGW_ACL_ADD));
$no_button = array();
if (is_array($content))
{
if(isset($content['delete']))
@ -101,25 +104,27 @@ class ui_resources
}
if(isset($content['save']))
{
if(!$content['cat_id'])
if(!$content['cat_id'] || !$content['name'])
{
return $this->edit($content['id'],'please choose a category');
$content['msg'] = 'You need to choose at least a name and a category!';
$this->tmpl->read('resources.edit');
$this->tmpl->exec('resources.ui_resources.edit',$content,$sel_options,$no_button);
return;
}
$content['msg'] = $this->bo->save($content);
if($content['msg'])
{
$this->tmpl->read('resources.edit');
$this->tmpl->exec('resources.ui_resources.edit',$content,$sel_options,$no_button);
}
$this->bo->save($content);
}
return $this->index();
}
$sel_options = array(
'cat_id' => $this->bo->acl->get_cats(PHPGW_ACL_ADD)
);
$no_button = array( // button not to show
);
if ($content > 0)
{
$preserv = array(
'id' => $content
);
$preserv = array('id' => $content);
$content = $this->bo->read($content);
}
else

View File

@ -1,5 +1,5 @@
<?php
// eTemplates for Application 'resources', generated by etemplate.dump() 2005-02-09 15:37
// eTemplates for Application 'resources', generated by etemplate.dump() 2005-02-11 13:57
/* $Id$ */
@ -11,12 +11,16 @@ $templ_data[] = array('name' => 'resources.edit','template' => '','lang' => '','
$templ_data[] = array('name' => 'resources.edit_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:6:"delete";}}}','size' => '100%','style' => '','modified' => '1093597552',);
$templ_data[] = array('name' => 'resources.edit_pictures','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:2:"c1";s:3:"nmr";s:2:"c2";s:3:"nmr";s:2:"c3";s:3:"nmr";}i:1;a:3:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:26:"Use general resources icon";s:5:"align";s:5:"right";}s:1:"B";a:3:{s:4:"type";s:5:"radio";s:4:"size";s:7:"gen_src";s:4:"name";s:11:"picture_src";}s:1:"C";a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"gen_scr_list";}}i:2;a:3:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:23:"Use the category\'s icon";s:5:"align";s:5:"right";}s:1:"B";a:3:{s:4:"type";s:5:"radio";s:4:"size";s:7:"cat_src";s:4:"name";s:11:"picture_src";}s:1:"C";a:1:{s:4:"type";s:5:"label";}}i:3;a:3:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:5:"label";s:15:"Use own picture";s:5:"align";s:5:"right";}s:1:"B";a:3:{s:4:"type";s:5:"radio";s:4:"size";s:6:"db_src";s:4:"name";s:11:"picture_src";}s:1:"C";a:2:{s:4:"type";s:4:"file";s:4:"name";s:8:"own_file";}}}','size' => '','style' => '','modified' => '1108124763',);
$templ_data[] = array('name' => 'resources.edit_tabs','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:1:"A";s:3:"250";s:2:"c1";s:6:"row_on";s:2:"c2";s:7:"row_off";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";s:4:"help";s:16:"Name of resource";}s:1:"B";a:6:{s:4:"type";s:6:"select";s:4:"size";s:10:"select one";s:5:"label";s:8:"Category";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"cat_id";s:4:"help";s:44:"Which category does this resource belong to?";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:3:"tab";s:4:"span";s:3:"all";s:5:"label";s:60:"General|Accessories|Pictures|Page|Location|Prizeing|Calendar";s:4:"name";s:60:"general|accessories|pictures|page|location|prizeing|calendar";s:4:"help";s:194:"General informations about resource|Informations about the location of resource|Prizeing information for booking or buying|Web-Page of resource|Pictures or resource|The Calendar of this resource";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}','size' => '100%','style' => '','modified' => '1107959809',);
$templ_data[] = array('name' => 'resources.edit_tabs.general','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:7:{i:0;a:1:{s:1:"C";s:2:"10";}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"Description (short)";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:17:"short_description";s:4:"help";s:29:"Short description of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:29:"Short description of resource";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Location";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:8:"location";s:4:"help";s:20:"Location of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Where to find this resource?";}}i:3;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:8:"quantity";s:4:"help";s:20:"Quantity of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Quantity of resource";}}i:4;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Useable";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:7:"useable";s:4:"help";s:29:"How many of them are useable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:38:"How many of the resources are useable?";}}i:5;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Bookable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:8:"bookable";s:4:"help";s:21:"Is resource bookable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"Is this resource bookable?";}}i:6;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Buyable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"buyable";s:4:"help";s:20:"Is resource buyable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:25:"Is this resource buyable?";}}}','size' => '100%','style' => '','modified' => '1093597682',);
$templ_data[] = array('name' => 'resources.edit_tabs.page','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"htmlarea";s:4:"name";s:16:"long_description";s:4:"help";s:26:"Web-Site for this resource";}}}','size' => '100%','style' => '','modified' => '1093599237',);
$templ_data[] = array('name' => 'resources.edit_tabs.pictures','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"size";s:1:"b";s:5:"label";s:7:"Picture";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"size";s:1:"b";s:5:"label";s:6:"Source";}}i:2;a:2:{s:1:"A";a:3:{s:4:"type";s:5:"image";s:5:"align";s:6:"center";s:4:"name";s:43:"resources.bo_resources.get_images,$cont[id]";}s:1:"B";a:2:{s:4:"type";s:8:"template";s:4:"name";s:23:"resources.edit_pictures";}}}','size' => '100%','style' => '','modified' => '1108126478',);
$templ_data[] = array('name' => 'resources.show','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:19:"resources.show.rows";s:4:"name";s:2:"nm";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}}}','size' => '100%','style' => '','modified' => '1098892283',);
$templ_data[] = array('name' => 'resources.show.actions','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[usable]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[category]";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:3:{s:4:"type";s:6:"button";s:5:"align";s:5:"right";s:4:"name";s:20:"lukas[$row_cont[id]]";}}}','size' => '100%','style' => '','modified' => '1098891355',);

View File

@ -1,5 +1,5 @@
<?php
// eTemplates for Application 'resources', generated by etemplate.dump() 2005-02-08 19:11
// eTemplates for Application 'resources', generated by etemplate.dump() 2005-02-11 11:42
/* $Id$ */
@ -11,12 +11,14 @@ $templ_data[] = array('name' => 'resources.edit','template' => '','lang' => '','
$templ_data[] = array('name' => 'resources.edit_buttons','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:1:{s:1:"C";s:4:"100%";}i:1;a:3:{s:1:"A";a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:4:"save";s:4:"help";s:21:"Saves entry and exits";}s:1:"B";a:3:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:6:"cancel";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:5:"align";s:5:"right";s:4:"name";s:6:"delete";}}}','size' => '100%','style' => '','modified' => '1093597552',);
$templ_data[] = array('name' => 'resources.edit_tabs','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:1:"A";s:3:"250";s:2:"c1";s:6:"row_on";s:2:"c2";s:7:"row_off";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";s:4:"help";s:16:"Name of resource";}s:1:"B";a:5:{s:4:"type";s:10:"select-cat";s:4:"size";s:10:"select one";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";s:4:"help";s:44:"Which category does this resource belong to?";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:3:"tab";s:4:"span";s:3:"all";s:5:"label";s:60:"General|Accessories|Pictures|Page|Location|Prizeing|Calendar";s:4:"name";s:60:"general|accessories|pictures|page|location|prizeing|calendar";s:4:"help";s:194:"General informations about resource|Informations about the location of resource|Prizeing information for booking or buying|Web-Page of resource|Pictures or resource|The Calendar of this resource";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}','size' => '100%','style' => '','modified' => '1094577031',);
$templ_data[] = array('name' => 'resources.edit_tabs','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:4:{i:0;a:3:{s:1:"A";s:3:"250";s:2:"c1";s:6:"row_on";s:2:"c2";s:7:"row_off";}i:1;a:2:{s:1:"A";a:4:{s:4:"type";s:4:"text";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";s:4:"help";s:16:"Name of resource";}s:1:"B";a:6:{s:4:"type";s:6:"select";s:4:"size";s:10:"select one";s:5:"label";s:8:"Category";s:7:"no_lang";s:1:"1";s:4:"name";s:6:"cat_id";s:4:"help";s:44:"Which category does this resource belong to?";}}i:2;a:2:{s:1:"A";a:5:{s:4:"type";s:3:"tab";s:4:"span";s:3:"all";s:5:"label";s:60:"General|Accessories|Pictures|Page|Location|Prizeing|Calendar";s:4:"name";s:60:"general|accessories|pictures|page|location|prizeing|calendar";s:4:"help";s:194:"General informations about resource|Informations about the location of resource|Prizeing information for booking or buying|Web-Page of resource|Pictures or resource|The Calendar of this resource";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}i:3;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}}}','size' => '100%','style' => '','modified' => '1107959809',);
$templ_data[] = array('name' => 'resources.edit_tabs.general','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:7:{i:0;a:1:{s:1:"C";s:2:"10";}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:19:"Description (short)";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:17:"short_description";s:4:"help";s:29:"Short description of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:29:"Short description of resource";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Location";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:6:"50,100";s:4:"name";s:8:"location";s:4:"help";s:20:"Location of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:28:"Where to find this resource?";}}i:3;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Quantity";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:8:"quantity";s:4:"help";s:20:"Quantity of resource";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Quantity of resource";}}i:4;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Useable";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:"5,10";s:4:"name";s:7:"useable";s:4:"help";s:29:"How many of them are useable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:38:"How many of the resources are useable?";}}i:5;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:8:"Bookable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:8:"bookable";s:4:"help";s:21:"Is resource bookable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"Is this resource bookable?";}}i:6;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:7:"Buyable";}s:1:"B";a:3:{s:4:"type";s:8:"checkbox";s:4:"name";s:7:"buyable";s:4:"help";s:20:"Is resource buyable?";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:25:"Is this resource buyable?";}}}','size' => '100%','style' => '','modified' => '1093597682',);
$templ_data[] = array('name' => 'resources.edit_tabs.page','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:8:"htmlarea";s:4:"name";s:16:"long_description";s:4:"help";s:26:"Web-Site for this resource";}}}','size' => '100%','style' => '','modified' => '1093599237',);
$templ_data[] = array('name' => 'resources.edit_tabs.pictures','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:2:{i:0;a:0:{}i:1;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"image";s:4:"name";s:36:"resources.bo_resources.get_images,id";}s:1:"B";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:3:{s:4:"type";s:5:"radio";s:4:"size";s:7:"gen_src";s:4:"name";s:11:"picture_src";}i:2;a:3:{s:4:"type";s:5:"radio";s:4:"size";s:7:"cat_src";s:4:"name";s:11:"picture_src";}i:3;a:3:{s:4:"type";s:5:"radio";s:4:"size";s:6:"db_src";s:4:"name";s:11:"picture_src";}}s:1:"C";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:2:{s:4:"type";s:6:"select";s:4:"name";s:12:"gen_scr_list";}i:2;a:1:{s:4:"type";s:5:"label";}i:3;a:2:{s:4:"type";s:4:"file";s:4:"name";s:8:"own_file";}}s:1:"D";a:5:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"3";i:1;a:2:{s:4:"type";s:5:"label";s:5:"label";s:26:"Use general resources icon";}i:2;a:2:{s:4:"type";s:5:"label";s:5:"label";s:23:"Use the category\'s icon";}i:3;a:2:{s:4:"type";s:5:"label";s:5:"label";s:15:"Use own picture";}}}}','size' => '','style' => '','modified' => '1108118511',);
$templ_data[] = array('name' => 'resources.show','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:0:{}i:1;a:1:{s:1:"A";a:3:{s:4:"type";s:9:"nextmatch";s:4:"size";s:19:"resources.show.rows";s:4:"name";s:2:"nm";}}i:2;a:1:{s:1:"A";a:3:{s:4:"type";s:6:"button";s:5:"label";s:3:"Add";s:4:"name";s:3:"add";}}}','size' => '100%','style' => '','modified' => '1098892283',);
$templ_data[] = array('name' => 'resources.show.actions','template' => '','lang' => '','group' => '0','version' => '','data' => 'a:3:{i:0;a:3:{s:1:"F";s:2:"3%";s:2:"c1";s:3:"nmh";s:2:"c2";s:3:"nmr";}i:1;a:6:{s:1:"A";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:4:"Name";s:4:"name";s:4:"name";}s:1:"B";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:17:"Short description";s:4:"name";s:17:"short_description";}s:1:"C";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:7:"Useable";s:4:"name";s:7:"useable";}s:1:"D";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Category";s:4:"name";s:6:"cat_id";}s:1:"E";a:3:{s:4:"type";s:20:"nextmatch-sortheader";s:5:"label";s:8:"Location";s:4:"name";s:8:"location";}s:1:"F";a:3:{s:4:"type";s:8:"template";s:5:"align";s:5:"right";s:4:"name";s:29:"resources.show.actions_header";}}i:2;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:12:"${row}[name]";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:25:"${row}[short_description]";}s:1:"C";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:14:"${row}[usable]";}s:1:"D";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[category]";}s:1:"E";a:3:{s:4:"type";s:5:"label";s:7:"no_lang";s:1:"1";s:4:"name";s:16:"${row}[location]";}s:1:"F";a:3:{s:4:"type";s:6:"button";s:5:"align";s:5:"right";s:4:"name";s:20:"lukas[$row_cont[id]]";}}}','size' => '100%','style' => '','modified' => '1098891355',);

View File

@ -1,24 +1,43 @@
<?php
$setup_info['resources']['name'] = 'resources';
$setup_info['resources']['title'] = 'Resource Management';
$setup_info['resources']['version'] = '0.0.1.011';
$setup_info['resources']['app_order'] = 1;
$setup_info['resources']['tables'] = array('egw_resources');
$setup_info['resources']['enable'] = 1;
/**************************************************************************\
* eGroupWare - resources *
* http://www.egroupware.org *
* *
* Written by Cornelius Weiss [egw@von-und-zu-weiss.de] *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
$setup_info['resources']['name'] = 'resources';
$setup_info['resources']['title'] = 'resources';
$setup_info['resources']['version'] = '0.0.1.012';
$setup_info['resources']['app_order'] = 1;
$setup_info['resources']['tables'] = array('egw_resources');
$setup_info['resources']['enable'] = 1;
/* The hooks this app includes, needed for hooks registration */
$setup_info['resources']['hooks'][] = 'admin';
// $setup_info['resources']['hooks'][] = 'home';
// $setup_info['resources']['hooks'][] = 'sidebox_menu';
// $setup_info['resources']['hooks'][] = 'settings';
// $setup_info['resources']['hooks'][] = 'preferences'
$setup_info['resources']['author'] = 'Cornelius Weiss';
$setup_info['resources']['license'] = 'GPL';
$setup_info['resources']['description'] = 'Resource management system';
$setup_info['resources']['note'] = 'This includes resource booking';
$setup_info['resources']['maintainer'] = array(
'name' => 'Cornelius Weiss',
'email' => 'egw@von-und-zu-weiss.de'
);
$setup_info['resources']['hooks'][] = 'admin';
// $setup_info['resources']['hooks'][] = 'home';
// $setup_info['resources']['hooks'][] = 'sidebox_menu';
// $setup_info['resources']['hooks'][] = 'settings';
// $setup_info['resources']['hooks'][] = 'preferences'
/* Dependencies for this app to work */
$setup_info['resources']['depends'][] = array(
$setup_info['resources']['depends'][] = array(
'appname' => 'phpgwapi',
'versions' => Array('1.0.0','1.0.1')
'versions' => Array('1.0.1')
);
$setup_info['resources']['depends'][] = array( // this is only necessary as long the etemplate-class is not in the api
$setup_info['resources']['depends'][] = array(
'appname' => 'etemplate',
'versions' => Array('1.0.0')
);
@ -26,3 +45,4 @@

View File

@ -28,7 +28,8 @@
'prize' => array('type' => 'varchar','precision' => '200'),
'long_description' => array('type' => 'longtext'),
'picture' => array('type' => 'blob'),
'accessories' => array('type' => 'varchar','precision' => '50')
'accessories' => array('type' => 'varchar','precision' => '50'),
'picture_src' => array('type' => 'varchar','precision' => '20')
),
'pk' => array('id'),
'fk' => array(),