diff --git a/infolog/delete.php b/infolog/delete.php index 63544d7648..5b4923c3e1 100644 --- a/infolog/delete.php +++ b/infolog/delete.php @@ -49,32 +49,32 @@ . "\n" . "\n"; - $phpgw->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $phpgw->template->set_file(array( 'info_delete' => 'delete.tpl' )); - $phpgw->template->set_var( $phpgw->infolog->setStyleSheet( )); - $phpgw->template->set_var( $phpgw->infolog->infoHeaders( )); - $phpgw->template->set_var( $phpgw->infolog->formatInfo( $info_id )); - $phpgw->template->set_var('lang_info_action',lang('Info Log - Delete')); + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file(array( 'info_delete' => 'delete.tpl' )); + $t->set_var( $phpgw->infolog->setStyleSheet( )); + $t->set_var( $phpgw->infolog->infoHeaders( )); + $t->set_var( $phpgw->infolog->formatInfo( $info_id )); + $t->set_var('lang_info_action',lang('Info Log - Delete')); - $phpgw->template->set_var('deleteheader',lang('Are you sure you want to delete this entry')); + $t->set_var('deleteheader',lang('Are you sure you want to delete this entry')); $nolinkf = $phpgw->link('/infolog/index.php',"sort=$sort&order=$order&query=$query&start=$start&filter=$filter"); $nolink = '' . lang('No') .''; - $phpgw->template->set_var('nolink',$nolink); - $phpgw->template->set_var('cancel_action',$nolinkf); - $phpgw->template->set_var('lang_cancel',lang('No - Cancel')); + $t->set_var('nolink',$nolink); + $t->set_var('cancel_action',$nolinkf); + $t->set_var('lang_cancel',lang('No - Cancel')); $yeslinkf = $phpgw->link('/infolog/delete.php',"info_id=$info_id&confirm=True&sort=" . "$sort&order=$order&query=$query&start=$start&filter=$filter"); $yeslink = '' . lang('Yes') . ''; - $phpgw->template->set_var('yeslink',$yeslink); - $phpgw->template->set_var('delete_action',$yeslinkf); - $phpgw->template->set_var('lang_delete',lang('Yes - Delete')); + $t->set_var('yeslink',$yeslink); + $t->set_var('delete_action',$yeslinkf); + $t->set_var('lang_delete',lang('Yes - Delete')); - $phpgw->template->pfp('out','info_delete'); + $t->pfp('out','info_delete'); $phpgw->common->phpgw_footer(); echo parse_navbar_end(); diff --git a/infolog/edit.php b/infolog/edit.php index 6a08691c7e..c9efd942d2 100644 --- a/infolog/edit.php +++ b/infolog/edit.php @@ -150,19 +150,19 @@ $pri_selected[$phpgw->infolog->data['info_pri']] = ' selected'; $status_selected[$phpgw->infolog->data['info_status']] = ' selected'; - $phpgw->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $phpgw->template->set_file(array('info_edit' => 'form.tpl')); + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file(array('info_edit' => 'form.tpl')); // ==================================================================== // create two seperate blocks, addblock will be cut off from template // editblock contains the buttons and forms for edit // ==================================================================== - $phpgw->template->set_block('info_edit', 'add', 'addhandle'); - $phpgw->template->set_block('info_edit', 'edit', 'edithandle'); - $phpgw->template->set_block('info_edit', 'subpro', 'subprohandle'); + $t->set_block('info_edit', 'add', 'addhandle'); + $t->set_block('info_edit', 'edit', 'edithandle'); + $t->set_block('info_edit', 'subpro', 'subprohandle'); if (is_array($error)) { - $phpgw->template->set_var('error_list',$phpgw->common->error_list($error)); + $t->set_var('error_list',$phpgw->common->error_list($error)); } switch ($action) { case 'sp': @@ -172,28 +172,28 @@ default: $info_action = 'Info Log - Edit'; break; } - $phpgw->template->set_var('lang_info_action',lang($info_action).($addrsearch?' - '.lang('Search for:')." '$addrsearch'":'')); - $phpgw->template->set_var($phpgw->infolog->setStyleSheet( )); - $phpgw->template->set_var('lang_category',lang('Category')); - $phpgw->template->set_var('lang_none',lang('None')); - $phpgw->template->set_var('cat_list',$phpgw->categories->formated_list('select','all',$phpgw->infolog->data['info_cat'],'True')); + $t->set_var('lang_info_action',lang($info_action).($addrsearch?' - '.lang('Search for:')." '$addrsearch'":'')); + $t->set_var($phpgw->infolog->setStyleSheet( )); + $t->set_var('lang_category',lang('Category')); + $t->set_var('lang_none',lang('None')); + $t->set_var('cat_list',$phpgw->categories->formated_list('select','all',$phpgw->infolog->data['info_cat'],'True')); - $phpgw->template->set_var('actionurl',$phpgw->link('/infolog/edit.php')); - $phpgw->template->set_var('common_hidden_vars',$common_hidden_vars); + $t->set_var('actionurl',$phpgw->link('/infolog/edit.php')); + $t->set_var('common_hidden_vars',$common_hidden_vars); - $phpgw->template->set_var('lang_owner',lang('Owner')); - $phpgw->template->set_var('owner_info',$phpgw->infolog->accountInfo($phpgw->infolog->data['info_owner'])); - $phpgw->template->set_var('lang_type',lang('Type')); - $phpgw->template->set_var('type_list',$phpgw->infolog->getEnum('type',$phpgw->infolog->data['info_type'],$phpgw->infolog->enums['type'])); + $t->set_var('lang_owner',lang('Owner')); + $t->set_var('owner_info',$phpgw->infolog->accountInfo($phpgw->infolog->data['info_owner'])); + $t->set_var('lang_type',lang('Type')); + $t->set_var('type_list',$phpgw->infolog->getEnum('type',$phpgw->infolog->data['info_type'],$phpgw->infolog->enums['type'])); - $phpgw->template->set_var('lang_prfrom', lang('From')); - $phpgw->template->set_var('fromval', $phpgw->strip_html($phpgw->infolog->data['info_from'])); - $phpgw->template->set_var('lang_praddr', lang('Phone/Email')); - $phpgw->template->set_var('addrval', $phpgw->strip_html($phpgw->infolog->data['info_addr'])); + $t->set_var('lang_prfrom', lang('From')); + $t->set_var('fromval', $phpgw->strip_html($phpgw->infolog->data['info_from'])); + $t->set_var('lang_praddr', lang('Phone/Email')); + $t->set_var('addrval', $phpgw->strip_html($phpgw->infolog->data['info_addr'])); - $phpgw->template->set_var('lang_search', lang('Search')); - $phpgw->template->set_var('lang_prproject', lang('Project')); - $phpgw->template->set_var('lang_proj_prompt', lang('Pattern for Search in Projects')); + $t->set_var('lang_search', lang('Search')); + $t->set_var('lang_prproject', lang('Project')); + $t->set_var('lang_proj_prompt', lang('Pattern for Search in Projects')); if (($proj_id = $phpgw->infolog->data['info_proj_id']) || $projectsearch) { $projects = createobject('projects.projects'); @@ -220,10 +220,10 @@ } if (!$project) $project = ''.lang('not set, use Button to search for').''; - $phpgw->template->set_var('project', $project); + $t->set_var('project', $project); - $phpgw->template->set_var('lang_praddrbook', lang('Addressbook')); - $phpgw->template->set_var('lang_addr_prompt', lang('Pattern for Search in Addressbook')); + $t->set_var('lang_praddrbook', lang('Addressbook')); + $t->set_var('lang_addr_prompt', lang('Pattern for Search in Addressbook')); if (($addr_id = $phpgw->infolog->data['info_addr_id']) || $addrsearch) { $contacts = createobject('phpgwapi.contacts'); @@ -250,12 +250,12 @@ if (!$addrbook) $addrbook = ''.lang('not set, use Button to search for').''; - $phpgw->template->set_var('addrbook', $addrbook); + $t->set_var('addrbook', $addrbook); - $phpgw->template->set_var('lang_prsubject', lang('Subject')); - $phpgw->template->set_var('subjectval', $phpgw->strip_html($phpgw->infolog->data['info_subject'])); - $phpgw->template->set_var('lang_prdesc', lang('Description')); - $phpgw->template->set_var('descval', $phpgw->strip_html($phpgw->infolog->data['info_des'])); + $t->set_var('lang_prsubject', lang('Subject')); + $t->set_var('subjectval', $phpgw->strip_html($phpgw->infolog->data['info_subject'])); + $t->set_var('lang_prdesc', lang('Description')); + $t->set_var('descval', $phpgw->strip_html($phpgw->infolog->data['info_des'])); // get month/day/year fields for startdate and enddate if ($phpgw->infolog->data['info_startdate'] == 0) { @@ -277,44 +277,44 @@ // get an instance of select box class $sm = CreateObject('phpgwapi.sbox'); - $phpgw->template->set_var('lang_start_date',lang('Start Date')); - $phpgw->template->set_var('start_select_date',$phpgw->common->dateformatorder($sm->getYears('syear',$syear,$syearset_var('lang_start_date',lang('Start Date')); + $t->set_var('start_select_date',$phpgw->common->dateformatorder($sm->getYears('syear',$syear,$syeargetMonthText('smonth', $smonth),$sm->getDays('sday', $sday))); - $phpgw->template->set_var('lang_end_date',lang('End Date')); - $phpgw->template->set_var('end_select_date',$phpgw->common->dateformatorder($sm->getYears('eyear', $eyear,$eyearset_var('lang_end_date',lang('End Date')); + $t->set_var('end_select_date',$phpgw->common->dateformatorder($sm->getYears('eyear', $eyear,$eyeargetMonthText('emonth', $emonth),$sm->getDays('eday', $eday))); - $phpgw->template->set_var('lang_selfortoday',lang('Today')); - $phpgw->template->set_var('selfortoday',' '); - $phpgw->template->set_var('lang_dur_days',lang('Duration')); - $phpgw->template->set_var('days',lang('days')); + $t->set_var('lang_selfortoday',lang('Today')); + $t->set_var('selfortoday',' '); + $t->set_var('lang_dur_days',lang('Duration')); + $t->set_var('days',lang('days')); - $phpgw->template->set_var('lang_status',lang('Status')); - $phpgw->template->set_var('status_list',$phpgw->infolog->getEnum('status',$phpgw->infolog->data['info_status'],$phpgw->infolog->enums['status'])); + $t->set_var('lang_status',lang('Status')); + $t->set_var('status_list',$phpgw->infolog->getEnum('status',$phpgw->infolog->data['info_status'],$phpgw->infolog->enums['status'])); - $phpgw->template->set_var('lang_priority',lang('Priority')); - $phpgw->template->set_var('priority_list',$phpgw->infolog->getEnum('pri',$phpgw->infolog->data['info_pri'],$phpgw->infolog->enums['priority'])); + $t->set_var('lang_priority',lang('Priority')); + $t->set_var('priority_list',$phpgw->infolog->getEnum('pri',$phpgw->infolog->data['info_pri'],$phpgw->infolog->enums['priority'])); - $phpgw->template->set_var('lang_confirm',lang('Confirm')); - $phpgw->template->set_var('confirm_list',$phpgw->infolog->getEnum('confirm',$phpgw->infolog->data['info_confirm'],$phpgw->infolog->enums['confirm'])); + $t->set_var('lang_confirm',lang('Confirm')); + $t->set_var('confirm_list',$phpgw->infolog->getEnum('confirm',$phpgw->infolog->data['info_confirm'],$phpgw->infolog->enums['confirm'])); - $phpgw->template->set_var('lang_responsible',lang('Responsible')); - $phpgw->template->set_var('responsible_list',$phpgw->infolog->getAccount('responsible',$phpgw->infolog->data['info_responsible'])); + $t->set_var('lang_responsible',lang('Responsible')); + $t->set_var('responsible_list',$phpgw->infolog->getAccount('responsible',$phpgw->infolog->data['info_responsible'])); - $phpgw->template->set_var('lang_access_type',lang('Private')); - $phpgw->template->set_var('access_list', 'infolog->data['info_access'] == 'private'?' checked':'') . '>'); + $t->set_var('lang_access_type',lang('Private')); + $t->set_var('access_list', 'infolog->data['info_access'] == 'private'?' checked':'') . '>'); - $phpgw->template->set_var('delete_action',$phpgw->link('/infolog/delete.php')); + $t->set_var('delete_action',$phpgw->link('/infolog/delete.php')); - $phpgw->template->set_var('edit_button',''); + $t->set_var('edit_button',''); if (!$action && $phpgw->infolog->check_access($info_id,PHPGW_ACL_DELETE)) { - $phpgw->template->set_var('delete_button',''); + $t->set_var('delete_button',''); } - $phpgw->template->set_var('edithandle',''); - $phpgw->template->set_var('addhandle',''); - $phpgw->template->set_var('subprohandle',''); - $phpgw->template->pfp('out','info_edit'); - $phpgw->template->pfp('edithandle','edit'); + $t->set_var('edithandle',''); + $t->set_var('addhandle',''); + $t->set_var('subprohandle',''); + $t->pfp('out','info_edit'); + $t->pfp('edithandle','edit'); // I would like to have it calculate the amount of days and drop it in days from now. diff --git a/infolog/index.php b/infolog/index.php index d49e0bdd4a..913c490faa 100644 --- a/infolog/index.php +++ b/infolog/index.php @@ -24,9 +24,9 @@ $db = $phpgw->db; $db2 = $phpgw->db; - $phpgw->template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); - $phpgw->template->set_file(array( 'info_list_t' => 'list.tpl' )); - $phpgw->template->set_block('info_list_t','info_list','list'); + $t = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); + $t->set_file(array( 'info_list_t' => 'list.tpl' )); + $t->set_block('info_list_t','info_list','list'); $grants = $phpgw->acl->get_grants('infolog'); @@ -44,37 +44,37 @@ switch ($action) { case 'sp': // Sub-List $common_hidden_vars .= ''; - $phpgw->template->set_var(lang_info_action,lang('Info Log - Subprojects from')); + $t->set_var(lang_info_action,lang('Info Log - Subprojects from')); break; case 'proj': $common_hidden_vars .= ''; $proj = $phpgw->infolog->readProj($proj_id); - $phpgw->template->set_var(lang_info_action,lang('Info Log').' - '.$proj['title']); + $t->set_var(lang_info_action,lang('Info Log').' - '.$proj['title']); break; case 'addr': $common_hidden_vars .= ''; $addr = $phpgw->infolog->readAddr($addr_id); - $phpgw->template->set_var(lang_info_action,lang('Info Log').' - '.$phpgw->infolog->addr2name($addr)); + $t->set_var(lang_info_action,lang('Info Log').' - '.$phpgw->infolog->addr2name($addr)); break; default: - $phpgw->template->set_var(lang_info_action,lang('Info Log')); + $t->set_var(lang_info_action,lang('Info Log')); break; } - $phpgw->template->set_var($phpgw->infolog->setStyleSheet( )); - $phpgw->template->set_var(actionurl,$phpgw->link('/infolog/edit.php?action=new')); - $phpgw->template->set_var('cat_form',$phpgw->link('/infolog/index.php')); - $phpgw->template->set_var('lang_category',lang('Category')); - $phpgw->template->set_var('lang_all',lang('All')); - $phpgw->template->set_var('lang_select',lang('Select')); - $phpgw->template->set_var('categories',$phpgw->categories->formated_list('select','all',$cat_id,'True')); - $phpgw->template->set_var(common_hidden_vars,$common_hidden_vars); + $t->set_var($phpgw->infolog->setStyleSheet( )); + $t->set_var(actionurl,$phpgw->link('/infolog/edit.php?action=new')); + $t->set_var('cat_form',$phpgw->link('/infolog/index.php')); + $t->set_var('lang_category',lang('Category')); + $t->set_var('lang_all',lang('All')); + $t->set_var('lang_select',lang('Select')); + $t->set_var('categories',$phpgw->categories->formated_list('select','all',$cat_id,'True')); + $t->set_var(common_hidden_vars,$common_hidden_vars); // =========================================== // list header variable template-declarations // =========================================== - $phpgw->template->set_var( $phpgw->infolog->infoHeaders( 1,$sort,$order )); - $phpgw->template->set_var(h_lang_sub,lang('Sub')); - $phpgw->template->set_var(h_lang_action,lang('Action')); + $t->set_var( $phpgw->infolog->infoHeaders( 1,$sort,$order )); + $t->set_var(h_lang_sub,lang('Sub')); + $t->set_var(h_lang_action,lang('Action')); // -------------- end header declaration ----------------- if (! $start) { @@ -115,20 +115,20 @@ } else { $total_matchs = lang('showing x',$total); } - $phpgw->template->set_var('total_matchs',$total_matchs); + $t->set_var('total_matchs',$total_matchs); // ========================================== // project description if subprojectlist // ========================================== - $phpgw->template->set_block('info_list_t','projdetails','projdetailshandle'); + $t->set_block('info_list_t','projdetails','projdetailshandle'); switch ($action) { case 'sp': // details of parent - $phpgw->template->set_var( $phpgw->infolog->infoHeaders( )); - $phpgw->template->set_var( $phpgw->infolog->formatInfo( $info_id )); - $phpgw->template->parse('projdetailshandle','projdetails',True); + $t->set_var( $phpgw->infolog->infoHeaders( )); + $t->set_var( $phpgw->infolog->formatInfo( $info_id )); + $t->parse('projdetailshandle','projdetails',True); break; case 'addr': break; @@ -142,7 +142,7 @@ $next_matchs = $phpgw->nextmatchs->show_tpl('/infolog/index.php',$start,$total, "&order=$order&filter=$filter&sort=$sort&query=$query&action=$action&info_id=$info_id&cat_id=$cat_id", '95%',$phpgw_info['theme']['th_bg']); - $phpgw->template->set_var(next_matchs,$next_matchs); + $t->set_var(next_matchs,$next_matchs); // ---------- end nextmatch template -------------------- $limit = $db->limit($start); @@ -162,44 +162,44 @@ } // ----------------------------------------- - $phpgw->nextmatchs->template_alternate_row_color(&$phpgw->template); + $phpgw->nextmatchs->template_alternate_row_color(&$t); - $phpgw->template->set_var( $phpgw->infolog->formatInfo( $db->Record,$proj_id,$addr_id )); + $t->set_var( $phpgw->infolog->formatInfo( $db->Record,$proj_id,$addr_id )); if ($phpgw->infolog->check_access($db->f('info_id'),PHPGW_ACL_EDIT)) { - $phpgw->template->set_var('edit','link('/infolog/edit.php','info_id=' . $db->f('info_id') . '&sort=' . $sort . '&order=' . $order . '&query=' . $query . '&start=' . $start . '&filter=' . $filter) . '">' . $phpgw->infolog->icon('action','edit') . ''); } else { - $phpgw->template->set_var('edit',''); + $t->set_var('edit',''); } if ($phpgw->infolog->check_access($db->f('info_id'),PHPGW_ACL_DELETE)) { - $phpgw->template->set_var('delete','link('/infolog/delete.php','info_id=' . $db->f('info_id') . '&sort=' . $sort . '&order=' . $order . '&query=' . $query . '&start=' . $start . '&filter=' . $filter) . '">' . $phpgw->infolog->icon('action','delete') . ''); } else { - $phpgw->template->set_var('delete',''); + $t->set_var('delete',''); } - $phpgw->template->set_var('subadd', ''); // defaults no icons - $phpgw->template->set_var('viewsub', ''); - $phpgw->template->set_var('viewparent', ''); + $t->set_var('subadd', ''); // defaults no icons + $t->set_var('viewsub', ''); + $t->set_var('viewparent', ''); if ($subproact > 0) { // if subprojects exist, display VIEW SUB icon - $phpgw->template->set_var('viewsub', 'link('/infolog/index.php','info_id=' . $db->f('info_id') . "&filter=$filter&action=sp") . '">' . $phpgw->infolog->icon('action','view') . ''); } else { // else display ADD SUB-Icon if ($phpgw->infolog->check_access($db->f('info_id'),PHPGW_ACL_ADD)) { - $phpgw->template->set_var('subadd', 'link('/infolog/edit.php','info_id=' . $db->f('info_id') . '&filter=' . $filter . '&action=sp') . '">' . $phpgw->infolog->icon('action','new') . ''); } } // if parent --> display VIEW SUBS of Parent if ($db->f('info_id_parent') && $action != 'sp') { - $phpgw->template->set_var('viewparent', 'link('/infolog/index.php','info_id=' . $db->f('info_id_parent') . "&filter=$filter&action=sp") . '">' . $phpgw->infolog->icon('action','parent') . ''); } - $phpgw->template->parse('list','info_list',True); + $t->parse('list','info_list',True); // -------------- end record declaration ------------------------ } @@ -208,7 +208,7 @@ // ========================================================= if ($action) { - $phpgw->template->set_var('lang_back2projects', '
link('/infolog/index.php',"filter=$filter"). '">'.lang('Back to Projectlist').''); } @@ -216,14 +216,14 @@ // get actual date and year for matrixview arguments /* $year = date('Y'); $month = date('m'); - $phpgw->template->set_var('lang_matrixviewhref', '
set_var('lang_matrixviewhref', '
'.lang('View Matrix of actual Month').''); */ // ============================================ // template declaration for Add Form // ============================================ - $phpgw->template->set_var(lang_add,lang('Add')); - $phpgw->template->pfp('out','info_list_t',true); + $t->set_var(lang_add,lang('Add')); + $t->pfp('out','info_list_t',true); // -------------- end Add form declaration ------------------------