[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: etemplate/inc class.sbox2.inc.php,1.1.1.1,1.2
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: etemplate/inc class.sbox2.inc.php,1.1.1.1,1.2 |
Date: |
Fri, 15 Feb 2002 00:26:10 -0500 |
Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv19627
Modified Files:
class.sbox2.inc.php
Log Message:
Patched in the changes of Revision 1.10 of the version in phpgwapi.
Changed from class projects to boprojects + some checks if class is availible.
Index: class.sbox2.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.sbox2.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.sbox2.inc.php 6 Feb 2002 09:03:34 -0000 1.1.1.1
--- class.sbox2.inc.php 15 Feb 2002 05:26:08 -0000 1.2
***************
*** 40,43 ****
--- 40,44 ----
* $content from id (eg. 'company: lastname,
givenname' for address $id) if $id != 0, or
* array with searchresult (id's as key),
if array is empty if search was unsucsessful
+ * $multipe present a multiple selectable box
instead of one selector-button
* Returns: array with vars to set in temaplate, the vars are:
* {doSearchFkt} Javascript Funktion, place
somewhere in Template (before rest of the vars)
***************
*** 47,58 ****
*
* To use call $template->set_var(getIdSearch( ... ));
! * the template should look like {doSeachFkt}
<tr><td>{XXX_title}</td><td>{XXX}</td><td>{XXX_nojs}</td></tr> (XXX is
content of $name)
* In the submitted page the vars $query_XXX and $id_XXX are
set according to what is selected, see getAddress as Example
*/
! function
getId($name,$lang_name,$prompt,$id_name,$content='',$note='')
{
// echo
"<p>getId('$name','$lang_name','$prompt',$id_name,'$content') =";
! $ret['doSearchFkt'] =
'<script language="JavaScript">'."\n".
" function doSearch(field,ask) {\n".
--- 48,59 ----
*
* To use call $template->set_var(getIdSearch( ... ));
! * the template should look like {doSearchFkt}
<tr><td>{XXX_title}</td><td>{XXX}</td><td>{XXX_nojs}</td></tr> (XXX is
content of $name)
* In the submitted page the vars $query_XXX and $id_XXX are
set according to what is selected, see getAddress as Example
*/
! function
getId($name,$lang_name,$prompt,$id_name,$content='',$note='',$multiple=False)
{
// echo
"<p>getId('$name','$lang_name','$prompt',$id_name,'$content') =";
! $ret['doSearchFkt'] =
'<script language="JavaScript">'."\n".
" function doSearch(field,ask) {\n".
***************
*** 67,71 ****
'</script>';
! $ret[$name.'_title'] = is_array($content) &&
count($content) ? $lang_name :
'<script language="JavaScript">'."\n".
" document.writeln('<input type=\"hidden\" name=\"query_$name\"
value=\"\">');\n".
--- 68,72 ----
'</script>';
! $ret[$name.'_title'] = is_array($content) &&
count($content) ? $lang_name :
'<script language="JavaScript">'."\n".
" document.writeln('<input type=\"hidden\" name=\"query_$name\"
value=\"\">');\n".
***************
*** 85,89 ****
{
$ret[$name.'_OK'] = ''; // flag we have
something so select
! $ret[$name] = "<select
name=\"id_$name\">\n";
while (list( $id,$text ) = each(
$content ))
{
--- 86,97 ----
{
$ret[$name.'_OK'] = ''; // flag we have
something so select
! if ($multiple)
! {
! $ret[$name] = '<select
name="id_'.$name.'[]" size=10 multiple>'."\n";
! }
! else
! {
! $ret[$name] = '<select
name="id_'.$name.'">'."\n";
! }
while (list( $id,$text ) = each(
$content ))
{
***************
*** 141,144 ****
--- 149,153 ----
* $id_name
id of the address for edit or 0 if none selected so far
* $query_name have to be
called $query_XXX, the search pattern after the submit, has to be passed back
to the function
+ * $multipe present
a multiple selectable box instead of one selector-button
* On Submit $id_XXX contains the selected address
(if != 0)
* $query_XXX search
pattern if the search button is pressed by the user, or '' if regular submit
***************
*** 147,152 ****
* Note As query's for an address are
submitted, you have to check $query_XXX if it is a search or a regular submit
(!$query_string)
*/
!
! function getAddress( $name,$id_name,$query_name,$title='')
{
// echo
"<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
--- 156,161 ----
* Note As query's for an address are
submitted, you have to check $query_XXX if it is a search or a regular submit
(!$query_string)
*/
!
! function getAddress(
$name,$id_name,$query_name,$title='',$multiple=False)
{
// echo
"<p>getAddress('$name',$id_name,'$query_name','$title')</p>";
***************
*** 177,182 ****
$title = lang('Addressbook');
}
!
! return $this->getId($name,$title,lang('Pattern for
Search in Addressbook'),$id_name,$content,lang('use Button to search for
Address'));
}
--- 186,190 ----
$title = lang('Addressbook');
}
! return $this->getId($name,$title,lang('Pattern for
Search in Addressbook'),$id_name,$content,lang('use Button to search for
Address'),$multiple);
}
***************
*** 267,274 ****
if ($id_name || $query_name)
{
! $projects = createobject('projects.projects');
if ($query_name)
{
! $projs = $projects->read_projects(
0,0,$query_name,'','','','',0 );
$content = array();
while ($projs && list( $key,$proj ) =
each( $projs ))
--- 275,286 ----
if ($id_name || $query_name)
{
! $projects = createobject('projects.boprojects');
! if (!is_object($projects))
! {
! return '';
! }
if ($query_name)
{
! $projs = $projects->list_projects(
0,0,$query_name,'','','','',0,'mains','' );
$content = array();
while ($projs && list( $key,$proj ) =
each( $projs ))
***************
*** 315,328 ****
$options .= ' MULTIPLE SIZE='.(0+$multiple);
if (substr($name,-2) != '[]')
$name .= '[]';
}
$out = "<select name=\"$name\" $options>\n";
! if (is_array($key)) $key = implode(',',$key);
!
while (list($k,$text) = each($arr))
{
$out .= '<option value="'.$k.'"';
! if($k == $key || strstr(",$key,",",$k,")) $out
.= " SELECTED";
$out .= ">" . ($no_lang || $text == '' ? $text
: lang($text)) . "</option>\n";
}
--- 327,347 ----
$options .= ' MULTIPLE SIZE='.(0+$multiple);
if (substr($name,-2) != '[]')
+ {
$name .= '[]';
+ }
}
$out = "<select name=\"$name\" $options>\n";
! if (is_array($key))
! {
! $key = implode(',',$key);
! }
while (list($k,$text) = each($arr))
{
$out .= '<option value="'.$k.'"';
! if($k == $key || strstr(",$key,",",$k,"))
! {
! $out .= " SELECTED";
! }
$out .= ">" . ($no_lang || $text == '' ? $text
: lang($text)) . "</option>\n";
}
***************
*** 335,340 ****
{ // reimplemented using getArrayItem
for ($i=0; $i <= 100; $i+=10)
$arr[$i] = "$i%";
!
return
$this->getArrayItem($name,$selected,$arr,1,$options);
}
--- 354,360 ----
{ // reimplemented using getArrayItem
for ($i=0; $i <= 100; $i+=10)
+ {
$arr[$i] = "$i%";
! }
return
$this->getArrayItem($name,$selected,$arr,1,$options);
}
***************
*** 350,356 ****
{ // reimplemented using getArrayItem
$arr = array(
! "private" => "Private",
! "public" => "Global public",
! "group" => "Group public"
);
--- 370,376 ----
{ // reimplemented using getArrayItem
$arr = array(
! 'private' => 'Private',
! 'public' => 'Global public',
! 'group' => 'Group public'
);
***************
*** 412,417 ****
if ($multiple < 0)
$aarr[] = lang('not assigned');
!
while ($a = current($accs))
{
--- 432,438 ----
if ($multiple < 0)
+ {
$aarr[] = lang('not assigned');
! }
while ($a = current($accs))
{
***************
*** 425,431 ****
--- 446,456 ----
{
if (is_array($date))
+ {
list($year,$month,$day) = $date;
+ }
elseif (!$date)
+ {
$day = $month = $year = 0;
+ }
else
{
***************
*** 444,449 ****
{
if (!is_object($this->cat))
$this->cat =
CreateObject('phpgwapi.categories');
!
if ($jscript)
{
--- 469,475 ----
{
if (!is_object($this->cat))
+ {
$this->cat =
CreateObject('phpgwapi.categories');
! }
if ($jscript)
{
***************
*** 454,458 ****
--- 480,486 ----
$options .= ' MULTIPLE SIZE='.(0+$multiple);
if (substr($name,-2) != '[]')
+ {
$name .= '[]';
+ }
}
/* Setup all and none first */
***************
*** 472,475 ****
--- 500,504 ----
$cats_link .=
$this->cat->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>'."\n";
+
return $cats_link;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: etemplate/inc class.sbox2.inc.php,1.1.1.1,1.2,
Ralf Becker <address@hidden> <=