[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.3,1.4
From: |
Marco Andriolo-Stagno (MAS!) <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.3,1.4 |
Date: |
Thu, 05 Dec 2002 10:08:30 -0500 |
Update of /cvsroot/phpgroupware/fax/inc
In directory subversions:/tmp/cvs-serv28240/inc
Modified Files:
class.manager.inc.php
Log Message:
changed the fax attachment preview scheme (to keep compatibility even with
older browser)
Index: class.manager.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/fax/inc/class.manager.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.manager.inc.php 2 Dec 2002 16:48:36 -0000 1.3
--- class.manager.inc.php 5 Dec 2002 15:08:26 -0000 1.4
***************
*** 27,31 ****
'compose' => True,
'sendfax' => True,
! 'cover_preview' => True
);
--- 27,32 ----
'compose' => True,
'sendfax' => True,
! 'cover_preview' => True,
! 'show' => True
);
***************
*** 163,172 ****
$all = '';
$query = $_POST['query'];
}
else
! {
! $query = '';
! }
!
# keep selected data
--- 164,171 ----
$all = '';
$query = $_POST['query'];
+
}
else
! { $query = ''; }
# keep selected data
***************
*** 187,190 ****
--- 186,190 ----
$url_send =
$GLOBALS['phpgw']->link('/index.php','menuaction=fax.manager.sendfax');
$preview_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=fax.manager.cover_preview');
+ $show_url =
$GLOBALS['phpgw']->link('/index.php','menuaction=fax.manager.show');
# WARNING! phpgwebhosting vs filemanager
***************
*** 216,220 ****
$tpl->set_block('send_fax', 'contacts_footer',
'write_contacts_footer');
$tpl->set_block('send_fax', 'submit_button',
'write_submit_button');
- $tpl->set_block('send_fax', 'show_preview', 'write_show_preview');
$contacts = CreateObject('addressbook.boaddressbook', TRUE);
--- 216,219 ----
***************
*** 251,254 ****
--- 250,254 ----
'old_filter' => $filter,
'submit_url' => $url_send,
+ 'show_url' => $show_url,
'filename' => $filename,
'filename_real' => $filename_real,
***************
*** 300,303 ****
--- 300,304 ----
'th_text' =>
$GLOBALS['phpgw_info']['theme']['th_text'],
'table_bg_color' =>
$GLOBALS['phpgw_info']['theme']['table_bg'],
+ #almost all themes have the same bg colours here :-(
'bg01' =>
$GLOBALS['phpgw_info']['theme']['bg02'],
'bg02' =>
$GLOBALS['phpgw_info']['theme']['bg03'],
***************
*** 305,309 ****
);
-
$tpl->set_var($data);
--- 306,309 ----
***************
*** 315,319 ****
$tpl->pparse('write_categories_footer', 'categories_footer');
! if ($cat_id != 'none' or isset($query) ) #or newquery)
{
if ($cat_id == 'all' or $query)
--- 315,319 ----
$tpl->pparse('write_categories_footer', 'categories_footer');
! if ($cat_id != 'none' or isset($query) )
{
if ($cat_id == 'all' or $query)
***************
*** 488,495 ****
{
$i = 1;
-
$tpl->set_var('sel', 'selected');
-
- # costruivo la copertina
}
else
--- 488,492 ----
***************
*** 508,513 ****
! #ToDO!!!!
! # Storage present?
#if
($GLOBALS['phpgw_info']['apps']['phpwebhosting']['enabled'] or
$GLOBALS['phpgw_info']['apps']['filemanager']['enabled'])
# { $tpl->pparse('write_faxdata_file_chooser',
'faxdata_file_chooser', TRUE); }
--- 505,509 ----
! #ToDO: filemanager|phpwebhosting present?
#if
($GLOBALS['phpgw_info']['apps']['phpwebhosting']['enabled'] or
$GLOBALS['phpgw_info']['apps']['filemanager']['enabled'])
# { $tpl->pparse('write_faxdata_file_chooser',
'faxdata_file_chooser', TRUE); }
***************
*** 605,608 ****
--- 601,605 ----
}
+ /*
case 'file_show';
{ # check for errors!
***************
*** 621,630 ****
{
$tpl->set_var('show_link',$to_show) ;}
!
$tpl->set_var('show_win_name','PROVA NOME FINESTRA');
$tpl->pparse('write_show_preview','show_preview');
#update_attach_data = True ;
break ;
!
}
}
}
--- 618,628 ----
{
$tpl->set_var('show_link',$to_show) ;}
! $tpl->set_var('show_win_name','
');
$tpl->pparse('write_show_preview','show_preview');
#update_attach_data = True ;
break ;
!
}
+ */
}
}
***************
*** 667,673 ****
$attach_array =
unserialize(urldecode(stripslashes($_POST['filename_data'])));
! print "<pre>";
! # print_r($contacts_data);
! print "</pre>";
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
--- 665,671 ----
$attach_array =
unserialize(urldecode(stripslashes($_POST['filename_data'])));
! #print "<pre>";
! #print_r($contacts_data);
! #print "</pre>";
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
***************
*** 763,786 ****
}
-
- #DEGUG CODE
-
- /*
- if ($data['type'] == 'file')
- { $fax_filename = $filename; }
- else
- {
- $rand_name = $this->randomname(12);
- $tmp_dir =
$GLOBALS['phpgw_info']['server']['temp_dir'];
- *
- $fax_filename =
$tmp_dir.SEP.'phpgw_fax_'.$user_login.'_'.$rand_name;
- *
- #ToDo: catch errors
- $fle = fopen($fax_filename, 'w+');
- fwrite($fle, $this->unhtmlentities($data['faxtext']));
- fclose($fle);
- }
- */
-
$fax_filename = '';
foreach ($attach_array as $attach_file)
--- 761,764 ----
***************
*** 793,797 ****
$faxcmd = "sendfax -c '".$comments."' ".$cover.$notify." -f
'".$user_login.$domain."' -i 'phpgroupware' -r '".$regarding."' -x '".
$dest['org_name']."' -y '".$dest['adr_one_locality']."' -d
'".$dest['tel_fax']."' ".$fax_filename;
!
# IF YOU WANT TO SEND THE FAXES FOR REAL UNCOMMENT THE
# FOLLOWING LINE!
--- 771,782 ----
$faxcmd = "sendfax -c '".$comments."' ".$cover.$notify." -f
'".$user_login.$domain."' -i 'phpgroupware' -r '".$regarding."' -x '".
$dest['org_name']."' -y '".$dest['adr_one_locality']."' -d
'".$dest['tel_fax']."' ".$fax_filename;
!
! /* ____ _____ _ ____ __ __ _____ _
! | _ \| ____| / \ | _ \| \/ | ____| |
! | |_) | _| / _ \ | | | | |\/| | _| | |
! | _ <| |___ / ___ \| |_| | | | | |___|_|
! |_| \_\_____/_/ \_\____/|_| |_|_____(_)
! */
!
# IF YOU WANT TO SEND THE FAXES FOR REAL UNCOMMENT THE
# FOLLOWING LINE!
***************
*** 801,804 ****
--- 786,790 ----
# FOLLOWING LINE!
print $faxcmd;
+
}
***************
*** 809,812 ****
--- 795,835 ----
}
+ function show()
+ {
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+ #print '<pre>';
+ #print_r ($_POST);
+ #print '</pre>';
+
+ $dl_pic =
$GLOBALS['phpgw']->common->image('fax','pdf.png');
+ # check for errors!
+
+ $tpl = CreateObject('phpgwapi.Template', PHPGW_APP_TPL);
+ $tpl->set_file(array('send_fax' => 'sendfax.tpl'));
+ $tpl->set_block('send_fax', 'show_preview',
'write_show_preview');
+
+ $to_show = $_POST['selected_file'];
+
+ $tpl->set_var('dl_pic',$dl_pic);
+ $tpl->set_var('name',$to_show);
+ $tpl->set_var('l_goback',lang('goback'));
+
+ # avoid pdf->pdf conversion; then a real pdf may have
colours
+ exec('file -bik '.$to_show,$ou);
+
+ if (substr($ou[0],0,15)!='application/pdf')
+ {
+ exec ('cp '.$to_show.' '.$to_show.'.txt');
+ exec ('convert -antialias -colorspace gray
'.$to_show.'.txt '.$to_show.'.pdf',$ou);
+ $tpl->set_var('show_link',$to_show.'.pdf');
+ }
+ else
+ { $tpl->set_var('show_link',$to_show) ;}
+
+ $tpl->set_var('show_win_name',' ');
+ $tpl->pparse('write_show_preview','show_preview');
+ #update_attach_data = True ;
+ }
function preferences()
***************
*** 856,860 ****
));
-
$prefs = $this->db->f('prefs');
if (!$prefs)
--- 879,882 ----
***************
*** 898,922 ****
}
- /* */
- #cambiare per php vecchi>?!
$user_name = $GLOBALS['phpgw']->accounts->data['fullname'];
-
-
$tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
-
- # mettere i dati a seconda della lingua!!
$c_faxnum = '000000';
! $recipient = 'phpgw preferences';
! $comments = 'Comment line \nComment line';
! $regarding = 'setting up preferences';
! $company = 'http://www.prosa.it';
!
! #### CHIAMARE LA FUNZIONE COVER PREVIEW ?!
$command = 'faxcover -C "'.$prefs['cover'].'" -f "'.$user_name.'"
-n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r "'.$regarding.'"
-x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
! exec ($command,$ou);
#ToDo: check for conver/faxcover commands
--- 920,937 ----
}
$user_name = $GLOBALS['phpgw']->accounts->data['fullname'];
$tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
$c_faxnum = '000000';
! $recipient = 'phpGroupWare';
! $comments = '... ... ...';
! $regarding = 'PROSA - free software -';
! $company = 'http://www.prosa.it';
+ #ToDo: use the cover_preview func?
$command = 'faxcover -C "'.$prefs['cover'].'" -f "'.$user_name.'"
-n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r "'.$regarding.'"
-x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
! exec ($command,$ou);
#ToDo: check for conver/faxcover commands
***************
*** 926,934 ****
$command = 'convert -size 596x842
'.$tmp_dir.SEP.$user_login.'_COVER.ps '.'/tmp/'.$user_login.'_COVER.jpg';
exec ($command, $ou);
! $tpl->set_var('img_src', '/tmp/'.$user_login.'_COVER.jpg');
$tpl->pparse('write_cover_footer', 'cover_footer');
-
}
--- 941,948 ----
$command = 'convert -size 596x842
'.$tmp_dir.SEP.$user_login.'_COVER.ps '.'/tmp/'.$user_login.'_COVER.jpg';
exec ($command, $ou);
! $tpl->set_var('img_src',
'/tmp/'.$user_login.'_COVER.jpg');
$tpl->pparse('write_cover_footer', 'cover_footer');
}
***************
*** 982,988 ****
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! print "<pre>";
#print_r ($_POST);
! print "</pre>";
$faxnumber = $_POST['faxnumber'];
--- 996,1002 ----
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
! #print "<pre>";
#print_r ($_POST);
! #print "</pre>";
$faxnumber = $_POST['faxnumber'];
***************
*** 1010,1019 ****
$user_login =
$GLOBALS['phpgw']->accounts->data['account_lid'];
$user_name = $GLOBALS['phpgw']->accounts->data['fullname'];
! # $account_id =
$GLOBALS['phpgw']->accounts->data['account_id'];
!
!
$tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
-
$command = 'faxcover -C "'.$cp.SEP.$cover_file.'" -f
"'.$user_name.'" -n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r
"'.$regarding.'" -x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
#print $command;
--- 1024,1031 ----
$user_login =
$GLOBALS['phpgw']->accounts->data['account_lid'];
$user_name = $GLOBALS['phpgw']->accounts->data['fullname'];
! #$account_id =
$GLOBALS['phpgw']->accounts->data['account_id'];
!
$tmp_dir = $GLOBALS['phpgw_info']['server']['temp_dir'];
$command = 'faxcover -C "'.$cp.SEP.$cover_file.'" -f
"'.$user_name.'" -n "'.$c_faxnum.'" -t "'.$recipient.'" -c "'.$comments.'" -r
"'.$regarding.'" -x "'.$company.'" > '.$tmp_dir.SEP.$user_login.'_COVER.ps';
#print $command;
***************
*** 1027,1031 ****
exec ($command, $ou);
-
$tpl->set_var('img_src',
'/tmp/'.$user_login.'_COVER.jpg');
$tpl->pparse('write_image','image',TRUE);
--- 1039,1042 ----
***************
*** 1050,1054 ****
echo parse_navbar();
! #ToDO: max fax:day/global/user/group?
$tpl->set_var(array
(
--- 1061,1065 ----
echo parse_navbar();
! #ToDO: add max fax/day ? or similar?
$tpl->set_var(array
(
***************
*** 1101,1105 ****
}
}
!
# false 0 startjob pop
# ing `when '' (e.g. `when done''). Note that `when
--- 1112,1116 ----
}
}
! # hylafax stuff!
# false 0 startjob pop
# ing `when '' (e.g. `when done''). Note that `when
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: fax/inc class.manager.inc.php,1.3,1.4,
Marco Andriolo-Stagno (MAS!) <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: fax/setup phpgw_en.lang,1.3,1.4 phpgw_it.lang,1.3,1.4 setup.inc.php,1.4,1.5
- Next by Date:
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/templates/phpgroupware/images/PSDs layout02-header.psd,1.1,NONE layout02.psd,1.1,NONE newlogo.psd,1.1,NONE
- Previous by thread:
[Phpgroupware-cvs] CVS: fax/setup phpgw_en.lang,1.3,1.4 phpgw_it.lang,1.3,1.4 setup.inc.php,1.4,1.5
- Next by thread:
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site/templates/phpgroupware/images/PSDs layout02-header.psd,1.1,NONE layout02.psd,1.1,NONE newlogo.psd,1.1,NONE
- Index(es):