73 lines
2.5 KiB
PHP
73 lines
2.5 KiB
PHP
<?php
|
|
/*=======================================================================
|
|
*
|
|
* job_edit.php
|
|
*
|
|
* Autor: Carsten Annacker
|
|
*
|
|
=======================================================================*/
|
|
|
|
include_once("../include/caglobal.inc.php");
|
|
include_once ("../include/auth.inc.php");
|
|
include_once("../include/global.inc.php");
|
|
//if ($phpVersion >= "7.0"):
|
|
// require_once("../PEAR/HTML/Template/IT.php");
|
|
//else:
|
|
// require_once("HTML/IT.php");
|
|
//endif;
|
|
|
|
// für Nacherfassungen und nachträgliche Änderungen von Aufträgen
|
|
// wenn job_id übergeben: Nachträgliche Änderung eines Auftrages
|
|
//list ($csc_id, $jb_id) =
|
|
getSecHttpVars("1", array("csc_id", "jb_id", "dbhistory"));
|
|
list ($jb_copy) = getHttpVars(array("jb_copy"));
|
|
list ($csc_id_start) = getHttpVars(array("csc_id_start"));
|
|
|
|
if ($jb_id != ""):
|
|
$what_is_this = "Auftragsänderung (Nr. $jb_id)";
|
|
$csc_id = getFieldValueFromId("job", "jb_id", "$jb_id", "csc_id");
|
|
else:
|
|
$what_is_this = "Auftragserfassung";
|
|
endif;
|
|
|
|
if ($csc_id != ""):
|
|
// csc_id übergeben: Auftragseingabe durch die Zentrale
|
|
// oder festgelegt durch jb_id (siehe oben)
|
|
$csc_id_orderer = $csc_id;
|
|
else:
|
|
// nix csc_id übergeben: Normaler Auftrag so wie es sich gehört
|
|
$usr_id = $HTTP_SESSION_VARS['usr_id'];
|
|
$usr_type = getFieldValueFromId("user", "usr_id", "$usr_id", "usr_type");
|
|
if ($usr_type == 2):
|
|
// customer (employee)
|
|
// Auftraggebende Kostenstelle wird aus angemeldetem employee ermittelt
|
|
$csc_id_orderer = $db->getOne("SELECT csc_id FROM employee WHERE emp_id = '$emp_id'");
|
|
elseif ($usr_type == 1):
|
|
// headquarter
|
|
$csc_id_orderer = 0;
|
|
else:
|
|
// sysadmin or courier -> not allowed to put jobs in the system
|
|
reportDie ("$PHP_SELF: Ungültiger 'usr_type': '$usr_type'", false);
|
|
endif;
|
|
endif;
|
|
|
|
//if ($phpVersion >= "7.0"):
|
|
// $tpl = new HTML_Template_IT();
|
|
//else:
|
|
// $tpl = new IntegratedTemplate();
|
|
//endif;
|
|
//$tpl->loadTemplatefile("job_edit.tpl.htm", true, true);
|
|
$output = file_get_contents("job_edit.tpl.htm");
|
|
//$tpl->setCurrentBlock("csc_id_orderer");
|
|
$output = str_replace("{_csc_id_orderer_}", ec($csc_id_orderer), $output);
|
|
$output = str_replace("{_what_is_this_}", $what_is_this, $output);
|
|
$output = str_replace("{_jb_id_}", ec($jb_id), $output);
|
|
$output = str_replace("{_jb_copy_}", $jb_copy, $output);
|
|
$output = str_replace("{_dbhistory_}", $dbhistory, $output);
|
|
$output = str_replace("{_csc_id_start_}", $csc_id_start, $output);
|
|
//$tpl->parseCurrentBlock("csc_id_orderer");
|
|
//$tpl->show();
|
|
echo $output;
|
|
|
|
?>
|