Fix: strict mode sunshine
This commit is contained in:
parent
6729cd9b4b
commit
a856ad0afa
@ -374,6 +374,9 @@ class Conf
|
||||
$this->format_date_hour_text_short="%d %b %Y %H:%M";
|
||||
$this->format_date_hour_text="%d %B %Y %H:%M";
|
||||
|
||||
// Duration of workday
|
||||
if (! isset($conf->global->MAIN_DURATION_OF_WORKDAY)) $this->global->MAIN_DURATION_OF_WORKDAY=86400;
|
||||
|
||||
// Limites decimales si non definie (peuvent etre egale a 0)
|
||||
if (! isset($this->global->MAIN_MAX_DECIMALS_UNIT)) $this->global->MAIN_MAX_DECIMALS_UNIT=5;
|
||||
if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2;
|
||||
|
||||
@ -790,16 +790,17 @@ function dol_delete_dir_recursive($dir,$count=0,$nophperrors=0)
|
||||
function dol_delete_preview($object)
|
||||
{
|
||||
global $langs,$conf;
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
|
||||
$element = $object->element;
|
||||
$dir = $conf->$element->dir_output;
|
||||
|
||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
||||
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture';
|
||||
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
||||
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
||||
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture';
|
||||
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
||||
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||
elseif ($object->element == 'fichinter') $dir = $conf->ficheinter->dir_output;
|
||||
else
|
||||
$dir = $conf->$element->dir_output;
|
||||
|
||||
if (empty($dir)) return 'ErrorObjectNoSupportedByFunction';
|
||||
|
||||
|
||||
@ -86,7 +86,8 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
|
||||
// Recupere emmetteur
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->code_pays) $this->emetteur->code_pays=substr($langs->defaultlang,-2); // By default, if not defined
|
||||
if (empty($this->emetteur->country_code))
|
||||
$this->emetteur->country_code = substr($langs->defaultlang,-2); // By default, if not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
@ -271,6 +272,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$nexY+=2; // Passe espace entre les lignes
|
||||
|
||||
// Detect if some page were added automatically and output _tableau for past pages
|
||||
// FIXME $pageposafter not defined
|
||||
while ($pagenb < $pageposafter)
|
||||
{
|
||||
if ($pagenb == 1)
|
||||
@ -553,7 +555,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
|
||||
}
|
||||
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target');
|
||||
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
|
||||
|
||||
// Show recipient
|
||||
$posy=42;
|
||||
|
||||
@ -44,7 +44,7 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
|
||||
* @param string $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -224,9 +224,6 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
dol_delete_preview($object);
|
||||
|
||||
// Success in building document. We build meta file.
|
||||
dol_meta_create($object);
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
|
||||
@ -87,7 +87,7 @@ class Fichinter extends CommonObject
|
||||
*/
|
||||
function create()
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $user, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::create ref=".$this->ref);
|
||||
|
||||
@ -156,8 +156,8 @@ class Fichinter extends CommonObject
|
||||
$result=$this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."fichinter");
|
||||
$this->db->commit();
|
||||
$this->id=$this->db->last_insert_id(MAIN_DB_PREFIX."fichinter");
|
||||
$this->db->commit();
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
@ -328,10 +328,9 @@ class Fichinter extends CommonObject
|
||||
* Validate a intervention
|
||||
*
|
||||
* @param User $user User that validate
|
||||
* @param string $outputdir Output directory
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function setValid($user, $outputdir)
|
||||
function setValid($user)
|
||||
{
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein
|
||||
$object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$result = $object->setValid($user, $conf->fichinter->outputdir);
|
||||
$result = $object->setValid($user);
|
||||
if ($result >= 0)
|
||||
{
|
||||
// Define output language
|
||||
@ -905,7 +905,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Duration
|
||||
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
||||
print '<td>'.convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||
print '<td>'.convertSecondToTime($object->duree, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Description (must be a textarea and not html must be allowed (used in list view)
|
||||
|
||||
@ -42,21 +42,12 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid,'fichinter');
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
if ($page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
if (! $sortfield) $sortfield="fd.date";
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$search_ref=GETPOST('search_ref','alpha');
|
||||
$search_company=GETPOST('search_company','alpha');
|
||||
|
||||
@ -23,9 +23,23 @@ require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php");
|
||||
|
||||
$langs->load("interventions");
|
||||
|
||||
$socid=GETPOST('socid', 'int');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
|
||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'ficheinter', '', 'fichinter');
|
||||
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="f.datei";
|
||||
|
||||
|
||||
/*
|
||||
@ -34,21 +48,7 @@ $result = restrictedArea($user, 'ficheinter', $fichinterid, 'fichinter');
|
||||
|
||||
llxHeader();
|
||||
|
||||
if ($sortorder == "")
|
||||
{
|
||||
$sortorder="ASC";
|
||||
}
|
||||
if ($sortfield == "")
|
||||
{
|
||||
$sortfield="f.datei";
|
||||
}
|
||||
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
|
||||
$limit = $conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
$now=dol_now();
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid as socid, f.description, f.ref";
|
||||
$sql.= ", f.datei as dp, f.rowid as fichid, f.fk_statut, f.duree";
|
||||
@ -56,23 +56,22 @@ $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f ";
|
||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
|
||||
|
||||
if ($socid > 0)
|
||||
{
|
||||
if (! empty($socid))
|
||||
$sql .= " AND s.rowid = " . $socid;
|
||||
}
|
||||
|
||||
if (empty ($MM))
|
||||
$MM=strftime("%m",time());
|
||||
|
||||
if (empty($MM))
|
||||
$MM=strftime("%m", $now);
|
||||
if (empty($YY))
|
||||
$YY=strftime("%Y",time());;
|
||||
$YY=strftime("%Y", $now);
|
||||
|
||||
echo "<div class='noprint'>";
|
||||
echo "\n<form action='rapport.php'>";
|
||||
echo '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
echo '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
echo "<input type='hidden' name='socid' value='".$socid."'>";
|
||||
echo $langs->trans("Month")." <input name='MM' size='2' value='$MM'>";
|
||||
echo " Année <input size='4' name='YY' value='$YY'>";
|
||||
echo "<input type='submit' name='g' value='Générer le rapport'>";
|
||||
echo "<input type='submit' name='action' value='generate' />";
|
||||
echo "<form>";
|
||||
echo "</div>";
|
||||
|
||||
@ -100,7 +99,7 @@ if ($resql)
|
||||
|
||||
$i = 0;
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="3">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Num</td>';
|
||||
if (empty($socid))
|
||||
print '<td>'.$langs->trans("Customers").'</td>';
|
||||
@ -120,9 +119,9 @@ if ($resql)
|
||||
|
||||
if (empty($socid))
|
||||
{
|
||||
if (!empty($MM)) $filter="&MM=$MM&YY=$YY";
|
||||
print '<td><a href="rapport.php?socid='.$objp->socid.$filter.'"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filter.png" border="0"></a> ';
|
||||
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=".$objp->rowid.$filter."\">".$objp->nom."</a></TD>\n";
|
||||
if (!empty($MM)) $filter='&MM='.$MM.'&YY='.$YY;
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?socid='.$objp->socid.$filter.'"><img src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/filter.png" border="0"></a> ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->rowid.$filter.'">'.$objp->nom.'</a></td>'."\n";
|
||||
}
|
||||
print '<td>'.nl2br($objp->description).'</td>';
|
||||
print "<td>".dol_print_date($db->jdate($objp->dp),"day")."</td>\n";
|
||||
@ -140,7 +139,8 @@ else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user