Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Leif Andersson
ReglerAddress
Commits
45649f50
Commit
45649f50
authored
Nov 16, 2015
by
Leif Andersson
Browse files
Lade till printICE
parent
315d42a7
Changes
6
Hide whitespace changes
Inline
Side-by-side
action.add_edit_Group.php
View file @
45649f50
...
...
@@ -4,7 +4,7 @@ if (!isset($gCms)) exit;
$ID
=
''
;
$paramKeys
=
array_keys
(
$params
);
$print
=
'print_'
;
$print
=
'print_'
;
$ICE
=
'ICE_'
;
foreach
(
$paramKeys
as
$key
)
{
$pos
=
strpos
(
$key
,
$print
);
if
(
$pos
===
false
)
continue
;
...
...
@@ -12,6 +12,13 @@ foreach ($paramKeys as $key) {
$this
->
Redirect
(
$id
,
'printGroup'
,
$returnid
,
array
(
'ID'
=>
$ID
));
return
;
}
foreach
(
$paramKeys
as
$key
)
{
$pos
=
strpos
(
$key
,
$ICE
);
if
(
$pos
===
false
)
continue
;
$ID
=
substr
(
$key
,
strlen
(
$ICE
));
$this
->
Redirect
(
$id
,
'printICE'
,
$returnid
,
array
(
'ID'
=>
$ID
));
return
;
}
if
(
isset
(
$params
[
'back'
]))
{
$this
->
Redirect
(
$id
,
'defaultadmin'
,
$returnid
,
array
());
}
...
...
action.editGroups.php
View file @
45649f50
...
...
@@ -25,6 +25,7 @@ foreach ($groups as $group) {
$group
->
change
=
''
;
}
$group
->
print
=
$this
->
CreateInputSubmit
(
$id
,
'print_'
.
$group
->
ID
,
'Skriv ut'
);
$group
->
ICE
=
$this
->
CreateInputSubmit
(
$id
,
'ICE_'
.
$group
->
ID
,
'ICE'
);
}
$place
=
$this
->
CreateInputSubmit
(
$id
,
'back'
,
'Tillbaka'
);
$smarty
->
assign
(
'backButton'
,
$place
);
...
...
action.printICE.php
0 → 100644
View file @
45649f50
<?php
if
(
!
isset
(
$gCms
))
exit
;
//echo '<pre>'; print_r($params); echo '</pre>';
$ID
=
$params
[
'ID'
];
$HEAD
=
<<<EOS
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8" />
<title>Grupp $ID</title>
<meta http-equiv="Content-Type" content="text/plain"/>
</head>
EOS;
$members
=
Person
::
getGroupMembers
(
$ID
);
$addresses
=
array
();
foreach
(
$members
as
$member
)
{
$rec
=
''
;
if
(
trim
(
$member
->
Namn
))
$rec
.
=
$member
->
Namn
.
PHP_EOL
;
if
(
$member
->
Telefon
)
$rec
.
=
' Telefon Kontor: '
.
$member
->
Telefon
.
PHP_EOL
;
if
(
$member
->
TelefonMobil
)
$rec
.
=
' Telefon Mobil: '
.
$member
->
TelefonMobil
.
PHP_EOL
;
if
(
$member
->
ICE
)
{
$rec
.
=
' ICE:'
.
PHP_EOL
;
$ICErows
=
explode
(
PHP_EOL
,
$member
->
ICE
);
foreach
(
$ICErows
as
$row
)
{
$rec
.
=
' '
.
$row
.
PHP_EOL
;
}
}
$records
[]
=
$rec
;
}
echo
$HEAD
;
echo
'<body>'
.
PHP_EOL
;
echo
'<pre>'
;
foreach
(
$records
as
$rec
)
echo
$rec
.
PHP_EOL
;
echo
'</pre>'
;
echo
'</body></html>'
;
exit
;
?>
lib/class.Groups.php
View file @
45649f50
...
...
@@ -38,7 +38,7 @@ EOS;
//public static $groupFields = array('ID', 'Gruppnamn', 'GruppInfo');
public
static
$groupFields
;
private
static
$buttonFields
=
array
(
'change'
,
'print'
);
private
static
$buttonFields
=
array
(
'change'
,
'print'
,
'ICE'
);
private
static
$instance
;
...
...
@@ -64,7 +64,7 @@ EOS;
$count
=
$result
->
RecordCount
();
switch
(
$count
)
{
case
0
:
die
(
sprintf
(
'Bad group ID %s'
.
PHP_EOL
,
$
adressID
));
die
(
sprintf
(
'Bad group ID %s'
.
PHP_EOL
,
$
param
[
0
]
));
break
;
case
1
:
$row
=
$result
->
FetchRow
();
...
...
lib/class.Person.php
View file @
45649f50
...
...
@@ -6,7 +6,7 @@ class Person {
select distinct Adresser.ID, concat(Fornamn, ' ', Efternamn) as Namn,
case when SkolaForetag is not null then SkolaForetag
when Adress is not null then Adress else Hem end as ForetagAdress,
Avdelning from Adresser,GruppAdress where
Avdelning
, Telefon, TelefonMobil, ICE
from Adresser,GruppAdress where
EOT;
private
static
$queryOne
=
<<<EOT
...
...
templates/groupEditPanel.tpl
View file @
45649f50
...
...
@@ -9,7 +9,7 @@
{
foreach
$Groups
as
$group
}
<tr><td>
{
$group
->
ID
}
</td><td>
{
$group
->
Gruppnamn
}
</td>
<td>
{
$group
->
GruppInfo
}
</td><td>
{
$group
->
change
}
</td>
<td>
{
$group
->
print
}
</td></tr>
<td>
{
$group
->
print
}
</td><
td>
{
$group
->
ICE
}
</td><
/tr>
{/
foreach
}
{/
if
}
<tr><td
colspan=
"5"
style=
"text-align: center;"
>
{
$newButton
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment