phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] projects/inc class.uiprojects_base.inc.php, 1.3 class


From: ceb
Subject: [Phpgroupware-cvs] projects/inc class.uiprojects_base.inc.php, 1.3 class.uiprojects.inc.php, 1.154
Date: Tue, 15 Mar 2005 14:17:00 +0100

Update of projects/inc

Modified Files:
     Branch: MAIN
            class.uiprojects_base.inc.php lines: +6 -8
            class.uiprojects.inc.php lines: +102 -176

Log Message:
update

====================================================
Index: projects/inc/class.uiprojects_base.inc.php
diff -u projects/inc/class.uiprojects_base.inc.php:1.2 
projects/inc/class.uiprojects_base.inc.php:1.3
--- projects/inc/class.uiprojects_base.inc.php:1.2      Tue Mar 15 01:10:42 2005
+++ projects/inc/class.uiprojects_base.inc.php  Tue Mar 15 13:17:54 2005
@@ -283,7 +283,7 @@

                        // 4. admin toolbar
                        $check = array('action' => $this->action,'coordinator' 
=> $this->pro_data['coordinator'],'main' => $this->pro_main,'parent' => 
$this->pro_parent);
-                       if($this->boprojects->edit_perms($check) || 
$this->boprojects->isprojectadmin('pad') || 
$this->boprojects->isprojectadmin('pmanager'))
+                       if($this->boprojects->edit_perms($check))
                        {
                                $icons  = 
$this->CreateButton(PROJECT_ACTIVITIES);
                                $icons .= 
$this->CreateButton(PROJECT_EMPLOYEES);
@@ -500,12 +500,10 @@
                                        }
                                        else
                                        {
-                                               $check = array(
-                                                 'action' => $this->action,
-                                                 'coordinator' => 
$this->pro_data['coordinator'],
-                                                 'main' => $this->pro_main,
-                                                 'parent' => $this->pro_parent
-                                               );
+                                               $check = array('action'         
        => $this->action,
+                                                                               
'coordinator'   => $this->pro_data['coordinator'],
+                                                                               
'main'                  => $this->pro_main,
+                                                                               
'parent'                => $this->pro_parent);
                                                if 
(!$this->boprojects->edit_perms($check))
                                                {
                                                        $buttonInActive = True;

====================================================
Index: projects/inc/class.uiprojects.inc.php
diff -u projects/inc/class.uiprojects.inc.php:1.153 
projects/inc/class.uiprojects.inc.php:1.154
--- projects/inc/class.uiprojects.inc.php:1.153 Mon Mar 14 17:39:39 2005
+++ projects/inc/class.uiprojects.inc.php       Tue Mar 15 13:17:54 2005
@@ -7,7 +7,7 @@
        * Project Manager                                                   *
        * Written by Bettina Gille address@hidden                   *
        * -----------------------------------------------                   *
-       * Copyright 2000 - 2004 Free Software Foundation, Inc.              *
+       * Copyright 2000 - 2005 Free Software Foundation, Inc.              *
        *                                                                   *
        * This program is free software; you can redistribute it and/or     *
        * modify it under the terms of the GNU General Public License as    *
@@ -145,10 +145,6 @@
                                
$GLOBALS['phpgw']->template->set_var('customer_main',$main['customerout']);
                                
$GLOBALS['phpgw']->template->set_var('customer_org_name',$main['customerorgout']);
                                
$GLOBALS['phpgw']->template->set_var('url_main',$main['url']);
-                               
$GLOBALS['phpgw']->template->set_var('attachment',$this->attached_files->get_files($pro_main));
-                               
$GLOBALS['phpgw']->template->set_var('lang_files',lang('Files'));
-                               $link = 
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.report&project_id='
 . $pro_main . '&generated=True');
-                               
$GLOBALS['phpgw']->template->set_var('report','<a href="' . $link . '"><img 
src="projects/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . 
'/images/document.png" title="' . lang('generate activity report') . '">' . 
lang('generate activity report') . '</a>');
                                
$GLOBALS['phpgw']->template->parse('main','project_main',True);
                        }

@@ -405,7 +401,7 @@
                                }
                        }

-                       
$GLOBALS['phpgw']->template->set_file(array('projects_list_t' => 
'list_tree.tpl'));
+                       
$GLOBALS['phpgw']->template->set_file(array('projects_list_t' => 'list.tpl'));
                        
$GLOBALS['phpgw']->template->set_block('projects_list_t','projects_list','list');
                        
$GLOBALS['phpgw']->template->set_block('projects_list_t','pro_sort_cols','sort_cols');
                        
$GLOBALS['phpgw']->template->set_block('projects_list_t','pro_cols','cols');
@@ -793,7 +789,7 @@
                        (
                                'menuaction'    => 
'projects.uiprojects.tree_view_projects',
                                'pro_main'              => $pro_main,
-                               'action'      => $action,
+                               'action'                => $action,
                                'project_id'    => $project_id,
                                'pro_parent'    => $pro_parent
                        );
@@ -918,7 +914,6 @@
                                        {
                                                $message = lang('project %1 has 
been saved',$values['title']);
                                        }
-                                       $values = 
$this->boprojects->read_single_project($project_id);
                                }
                        }

@@ -939,10 +934,31 @@
                                
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                        }

-                       if($_POST['mstone'])
+                       if($_POST['mstone_save'] || $_GET['mstone_save'])
                        {
-                               $link_data['menuaction'] = 
'projects.uiprojects.project_mstones';
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+                               $mstone_edate   = 
get_var('mstone_edate',array('GET','POST'));
+                               $vmstone                = 
get_var('vmstone',array('GET','POST'));
+
+                               if(is_array($mstone_edate))
+                               {
+                                       $mstone_end_array       = 
$jscal->input2date($mstone_edate['str']);
+                                       $mstone_end_val         = 
$mstone_end_array['raw'];
+                               }
+
+                               $mstone['project_id']   = $project_id;
+                               $mstone['edate']                = 
$mstone_end_val;
+                               $mstone['title']                = 
$vmstone['title'];
+
+                               $error = 
$this->boprojects->check_mstone($mstone);
+                               if(is_array($error))
+                               {
+                                       $message = 
$GLOBALS['phpgw']->common->error_list($error);
+                               }
+                               else
+                               {
+                                       $this->boprojects->save_mstone($mstone);
+                                       $message = lang('milestone has been 
saved');
+                               }
                        }

                        if($_POST['roles'])
@@ -962,13 +978,14 @@
                                {
                                        
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
                                }
+
+                               $check = array('action' => 
$action,'coordinator' => $values['coordinator'],'main' => 
$values['main'],'parent' => $values['parent']);
+                               if(!$this->boprojects->edit_perms($check))
+                               {
+                                       
$GLOBALS['phpgw']->redirect_link('/index.php',$link_data);
+                               }
                        }

-/*
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . ($project_id?lang('edit project'):lang('add project'))
-                                                                               
                                        . $this->admin_header_info();
-                       $this->display_app_header();
-*/
                        $this->ui_base->display_app_header();

                        $GLOBALS['phpgw']->template->set_file(array('edit_form' 
=> 'form.tpl'));
@@ -980,6 +997,10 @@
                        
$GLOBALS['phpgw']->template->set_block('edit_form','elist','elisthandle');
                        
$GLOBALS['phpgw']->template->set_block('edit_form','efield','efieldhandle');

+                       
$GLOBALS['phpgw']->template->set_block('edit_form','mstones_tab','mstones_tabhandle');
+                       
$GLOBALS['phpgw']->template->set_block('edit_form','mstones_tabcontent','mstones_tabcontenthandle');
+                       
$GLOBALS['phpgw']->template->set_block('edit_form','mstone_list','mlist');
+
                        
$GLOBALS['phpgw']->template->set_block('edit_form','accounting_act','accounting_acthandle');
                        
$GLOBALS['phpgw']->template->set_block('edit_form','accounting_own','accounting_ownhandle');

@@ -1030,7 +1051,7 @@

                        if ($project_id)
                        {
-                               $values = 
$this->boprojects->read_single_project($project_id);
+                               //$values = 
$this->boprojects->read_single_project($project_id);

                                if(($_POST['save'] || $_POST['apply']) && 
$error)
                                {
@@ -1088,9 +1109,72 @@
                                
$GLOBALS['phpgw']->template->set_var('lang_milestones',lang('milestones').':');
                                
$GLOBALS['phpgw']->template->set_var('edit_mstones_button','<input 
type="submit" name="mstone" value="' . lang('edit milestones') . '">');
                                
$GLOBALS['phpgw']->template->set_var('edit_roles_events_button','<input 
type="submit" name="roles" value="' . lang('edit roles and events') . '">');
+
+
+// ---- BEGIN MILESTONES
+
+                               $mstones = 
$this->boprojects->get_mstones($project_id);
+
+                               if(is_array($mstones))
+                               {
+                                       for($i=0;$i<count($mstones);++$i)
+                                       {
+                                               
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
+
+                                               $link_data['s_id'] = 
$mstones[$i]['s_id'];
+
+                                               
$GLOBALS['phpgw']->template->set_var(array
+                                               (
+                                                       'mstone_datedue'        
=> $this->boprojects->formatted_edate($mstones[$i]['edate'],True,'ms'),
+                                                       'mstone_edit_url'       
=> $GLOBALS['phpgw']->link('/index.php',$link_data),
+                                                       'mstone_title'          
=> $mstones[$i]['title']
+                                               ));
+                                               
$GLOBALS['phpgw']->template->set_var('edit_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','edit')
+                                                                               
                                        . '" border="0" title="' . lang('edit') 
. '">');
+                                               $link_data['edit_mstone'] = 
True;
+                                               
$GLOBALS['phpgw']->template->set_var('mstone_edit_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
+                                               
unset($link_data['edit_mstone']);
+
+                                               if 
($this->boprojects->edit_perms(array('action' => $action,'main' => 
$parent['pro_main'],'parent' => $parent['project_id'],'type' => 'delete',
+                                                                               
                                        'coordinator' => $pro['coordinator'])))
+                                               {
+                                                       
$link_data['delete_mstone']     = True;
+
+                                                       
$GLOBALS['phpgw']->template->set_var('mstone_delete_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
+                                                       
$GLOBALS['phpgw']->template->set_var('delete_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','delete')
+                                                                               
                                                                . '" border="0" 
title="' . lang('delete') . '">');
+                                                       
unset($link_data['delete_mstone']);
+                                               }
+                                               
$GLOBALS['phpgw']->template->fp('list_mlist','mstone_list',True);
+                                       }
+                               }
+
+                               
$GLOBALS['phpgw']->template->set_var('mstone_old_edate',$mstone_edate);
+                               
$GLOBALS['phpgw']->template->set_var('s_id',$values['s_id']);
+                               
$GLOBALS['phpgw']->template->set_var('lang_new',lang('new milestone'));
+                               
$GLOBALS['phpgw']->template->set_var('lang_save_mstone',lang('save milestone'));
+                               
$GLOBALS['phpgw']->template->set_var('new_checked',$values['new']?' 
checked':'');
+                               
$GLOBALS['phpgw']->template->set_var('mstone_title',$GLOBALS['phpgw']->strip_html($vmstone['mstone_title']));
+
+                               $end = 
$end_val?$end_val:($values['edate']?mktime(12,0,0,date('m',$values['edate']),date('d',$values['edate']),date('Y',$values['edate'])):mktime(12,0,0,date('m'),date('d'),date('Y')));
+                               
$GLOBALS['phpgw']->template->set_var('mstone_end_date_select',$jscal->input('mstone_edate[str]',$end));
+
+                               
$GLOBALS['phpgw']->template->fp('mstones_tabhandle','mstones_tab',True);
+                               
$GLOBALS['phpgw']->template->fp('mstones_tabcontenthandle','mstones_tabcontent',True);
+
+                               
$GLOBALS['phpgw']->template->set_var('number_Tabs','5');
+
+// --------- END MILESTONES
+
+
                        }
                        else
                        {
+                               
$GLOBALS['phpgw']->template->set_var('number_Tabs','4');
+                               
$GLOBALS['phpgw']->template->set_var('mstones_tabhandle','');
+                               
$GLOBALS['phpgw']->template->set_var('mstones_tabcontenthandle','');
+                               
$GLOBALS['phpgw']->template->set_var('mlist','');
+
                                if($this->boprojects->siteconfig['projectnr'] 
== 'generate')
                                {
                                        
$GLOBALS['phpgw']->template->set_var('choose','<input type="checkbox" 
name="values[choose]" value="True"' . (isset($values['choose'])?' checked':'') 
. '>');
@@ -1957,164 +2041,6 @@
                        
$GLOBALS['phpgw']->template->pfp('out','projects_list_t',True);
                }

-
-// ---- MILESTONES -----
-
-               function project_mstones()
-               {
-                       $action         = get_var('action',array('GET','POST'));
-                       $project_id     = 
get_var('project_id',array('GET','POST'));
-                       $values         = get_var('values',array('POST'));
-                       $s_id           = get_var('s_id',array('GET','POST'));
-                       $edate          = get_var('edate',array('POST','GET'));
-
-                       if(!$_POST['save'] && !$_GET['delete'] && 
!$_POST['done'] && !$_GET['edit'])
-                       {
-                               $referer = get_var('referer',array('POST'));
-                       }
-                       if($_POST['save'] || $_GET['delete'] || $_POST['done'] 
|| $_GET['back'] || $_GET['edit'])
-                       {
-                               $referer = get_var('referer',array('GET'));
-                       }
-                       if(!$referer)  //$_POST['back'] && !$_POST['done'] && 
!$_POST['edit'])
-                       {
-                               $referer = $_SERVER['HTTP_REFERER'];
-                       }
-
-                       //echo 'REFERER: ' . $referer;
-
-                       $link_data = array
-                       (
-                               'menuaction'    => 
'projects.uiprojects.project_mstones',
-                               'action'                => $action,
-                               'project_id'    => $project_id,
-                               'referer'               => $referer
-                       );
-
-                       $jscal = CreateObject('phpgwapi.jscalendar');
-
-                       if(is_array($edate))
-                       {
-                               $end_array      = 
$jscal->input2date($edate['str']);
-                               $end_val        = $end_array['raw'];
-                       }
-
-                       if ($_POST['save'])
-                       {
-                               $values['s_id']                 = 
$values['new']?'':$s_id;
-                               $values['project_id']   = $project_id;
-                               $values['edate']                = $end_val;
-                               $error = 
$this->boprojects->check_mstone($values);
-                               if(is_array($error))
-                               {
-                                       $message = 
$GLOBALS['phpgw']->common->error_list($error);
-                               }
-                               else
-                               {
-                                       $this->boprojects->save_mstone($values);
-                                       $message = lang('milestone has been 
saved');
-                               }
-                       }
-
-                       if ($_POST['done'])
-                       {
-                               unset($jscal);
-                               $link = array
-                               (
-                                       'menuaction'    => 
'projects.uiprojects.edit_project',
-                                       'action'                => 'mains',
-                                       'project_id'    => $project_id
-                               );
-                               
$GLOBALS['phpgw']->redirect_link('/index.php',$link);
-                               //Header('Location: ' . $referer);
-                       }
-
-                       if ($_GET['delete'])
-                       {
-                               $this->boprojects->delete_item(array('id' => 
$s_id));
-                               $message = lang('milestone has been deleted');
-                       }
-
-                       if($_GET['edit'])
-                       {
-                               $values = 
$this->boprojects->get_single_mstone($s_id);
-                       }
-
-                       $GLOBALS['phpgw_info']['flags']['app_header'] = 
lang('projects') . ': ' . lang('edit milestones') . $this->admin_header_info();
-                       //$this->display_app_header();
-                       $this->ui_base->display_app_header();
-                       $this->set_app_langs();
-
-                       
$GLOBALS['phpgw']->template->set_file(array('mstone_list_t' => 
'list_mstones.tpl'));
-                       
$GLOBALS['phpgw']->template->set_block('mstone_list_t','mstone_list','list');
-                       
$GLOBALS['phpgw']->template->set_block('mstone_list_t','project_data','pro');
-
-                       $pro = 
$this->boprojects->read_single_project($project_id);
-                       
$GLOBALS['phpgw']->template->set_var('title_pro',$pro['title']);
-                       
$GLOBALS['phpgw']->template->set_var('pro_url',$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.view_project&action='
-                                                                               
                                . ($pro['level']==0?'mains':'subs') . 
'&project_id=' . $project_id));
-                       
$GLOBALS['phpgw']->template->set_var('coordinator_pro',$pro['coordinatorout']);
-                       
$GLOBALS['phpgw']->template->set_var('number_pro',$pro['number']);
-                       
$GLOBALS['phpgw']->template->set_var('customer_pro',$pro['customerout']);
-                       
$GLOBALS['phpgw']->template->set_var('customerorg_pro',$pro['customerorgout']);
-                       
$GLOBALS['phpgw']->template->set_var('url_pro',$pro['url']);
-                       
$GLOBALS['phpgw']->template->set_var('sdate',$pro['sdate_formatted']);
-                       
$GLOBALS['phpgw']->template->set_var('edate',$pro['edate_formatted']);
-
-
-                       
$GLOBALS['phpgw']->template->parse('pro','project_data',True);
-
-                       
$GLOBALS['phpgw']->template->set_var('message',$message);
-                       
$GLOBALS['phpgw']->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
-
-                       $mstones = $this->boprojects->get_mstones($project_id);
-
-                       if(is_array($mstones))
-                       {
-                               for($i=0;$i<count($mstones);$i++)
-                               {
-                                       
$this->nextmatchs->template_alternate_row_color(&$GLOBALS['phpgw']->template);
-
-                                       $link_data['s_id']                      
= $mstones[$i]['s_id'];
-                                       $link_data['edit']                      
= True;
-
-                                       
$GLOBALS['phpgw']->template->set_var(array
-                                       (
-                                               'datedue'       => 
$this->boprojects->formatted_edate($mstones[$i]['edate'],True,'ms'),
-                                               'edit_url'      => 
$GLOBALS['phpgw']->link('/index.php',$link_data),
-                                               'title'         => 
$mstones[$i]['title']
-                                       ));
-                                       
$GLOBALS['phpgw']->template->set_var('edit_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','edit')
-                                                                               
                                                        . '" border="0" 
title="' . lang('edit') . '">');
-                                       unset($link_data['edit']);
-
-                                       if 
($this->boprojects->edit_perms(array('action' => $action,'main' => 
$pro['main'],'parent' => $pro['parent'],'type' => 'delete',
-                                                                               
                                        'coordinator' => $pro['coordinator'])))
-                                       {
-                                               $link_data['menuaction']        
= 'projects.uiprojects.project_mstones';
-                                               $link_data['delete']            
= True;
-
-                                               
$GLOBALS['phpgw']->template->set_var('delete_url',$GLOBALS['phpgw']->link('/index.php',$link_data));
-                                               
$GLOBALS['phpgw']->template->set_var('delete_img','<img src="' . 
$GLOBALS['phpgw']->common->image('phpgwapi','delete')
-                                                                               
                                                                . '" border="0" 
title="' . lang('delete') . '">');
-                                               unset($link_data['delete']);
-                                       }
-                                       
$GLOBALS['phpgw']->template->parse('list','mstone_list',True);
-                               }
-                       }
-                       
$GLOBALS['phpgw']->template->set_var('old_edate',$values['edate']);
-                       
$GLOBALS['phpgw']->template->set_var('s_id',$values['s_id']);
-                       
$GLOBALS['phpgw']->template->set_var('lang_new',lang('new milestone'));
-                       
$GLOBALS['phpgw']->template->set_var('lang_save_mstone',lang('save milestone'));
-                       
$GLOBALS['phpgw']->template->set_var('new_checked',$values['new']?' 
checked':'');
-                       
$GLOBALS['phpgw']->template->set_var('title',$GLOBALS['phpgw']->strip_html($values['title']));
-
-                       $end = 
$end_val?$end_val:($values['edate']?mktime(12,0,0,date('m',$values['edate']),date('d',$values['edate']),date('Y',$values['edate'])):mktime(12,0,0,date('m'),date('d'),date('Y')));
-                       
$GLOBALS['phpgw']->template->set_var('end_date_select',$jscal->input('edate[str]',$end));
-
-                       
$GLOBALS['phpgw']->template->pfp('out','mstone_list_t',True);
-               }
-
                function assign_employee_roles()
                {
                        $action         = get_var('action',array('GET','POST'));






reply via email to

[Prev in Thread] Current Thread [Next in Thread]