';
diff --git a/htdocs/categories/liste.php b/htdocs/categories/liste.php
index f91b81ea5e5..143aac02eec 100644
--- a/htdocs/categories/liste.php
+++ b/htdocs/categories/liste.php
@@ -28,47 +28,47 @@ require_once(DOL_DOCUMENT_ROOT."/categories/class/categorie.class.php");
if (!$user->rights->categorie->lire) accessforbidden();
-llxHeader ("","",$langs->trans("Categories"));
+llxHeader("","",$langs->trans("Categories"));
-print_fiche_titre ($langs->trans ("CatList"));
+print_fiche_titre($langs->trans("CatList"));
print '';
print '';
-$c = new Categorie ($db);
-$cats = $c->get_all_categories ();
+$c = new Categorie($db);
+$cats = $c->get_all_categories();
if ($cats != -1)
{
- print '';
- print '';
- print '| '.$langs->trans("Ref").' | ';
- print ''.$langs->trans("Description").' | ';
- print ''.$langs->trans("Type").' | ';
- print ' ';
-
- $var=true;
- foreach ($cats as $cat)
+ print '';
+ print '';
+ print '| '.$langs->trans("Ref").' | ';
+ print ''.$langs->trans("Description").' | ';
+ print ''.$langs->trans("Type").' | ';
+ print ' ';
+
+ $var=true;
+ foreach ($cats as $cat)
{
- $var = ! $var;
- print "\t\n";
- print "\t\t| ".$cat->label." | \n";
- print "\t\t".dol_trunc($cat->description,36)." | \n";
- print '';
- if ($cat->type == 0) print $langs->trans("Product");
- elseif ($cat->type == 1) print $langs->trans("Supplier");
- elseif ($cat->type == 2) print $langs->trans("Customer");
- else print $cat->type;
- print " | \n";
- print "\t \n";
+ $var = ! $var;
+ print "\t\n";
+ print "\t\t| ".$cat->label." | \n";
+ print "\t\t".dol_trunc($cat->description,36)." | \n";
+ print '';
+ if ($cat->type == 0) print $langs->trans("Product");
+ elseif ($cat->type == 1) print $langs->trans("Supplier");
+ elseif ($cat->type == 2) print $langs->trans("Customer");
+ else print $cat->type;
+ print " | \n";
+ print "\t \n";
}
- print " ";
+ print " ";
}
else
{
- dol_print_error();
+ dol_print_error();
}
print ' | ';
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index 3a810ddab0c..56d2d844204 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -43,8 +43,8 @@ $confirm=GETPOST('confirm');
if ($id == "")
{
- dol_print_error('','Missing parameter id');
- exit();
+ dol_print_error('','Missing parameter id');
+ exit();
}
// Security check
@@ -58,22 +58,22 @@ $object = new Categorie($db);
if ($_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
- if ($id)
- {
- $result = $object->fetch($id);
+ if ($id)
+ {
+ $result = $object->fetch($id);
- $result = $object->add_photo($conf->categorie->dir_output, $_FILES['userfile']);
- }
+ $result = $object->add_photo($conf->categorie->dir_output, $_FILES['userfile']);
+ }
}
if ($action == 'confirm_delete' && $_GET["file"] && $confirm == 'yes' && $user->rights->categorie->creer)
{
- $object->delete_photo($conf->categorie->dir_output."/".$_GET["file"]);
+ $object->delete_photo($conf->categorie->dir_output."/".$_GET["file"]);
}
if ($action == 'addthumb' && $_GET["file"])
{
- $object->add_thumb($conf->categorie->dir_output."/".$_GET["file"]);
+ $object->add_thumb($conf->categorie->dir_output."/".$_GET["file"]);
}
@@ -81,223 +81,223 @@ if ($action == 'addthumb' && $_GET["file"])
* View
*/
-llxHeader ("","",$langs->trans("Categories"));
+llxHeader("","",$langs->trans("Categories"));
$html = new Form($db);
if (!empty($id) || !empty($ref))
{
- $result = $object->fetch($id);
+ $result = $object->fetch($id);
- if ($result)
- {
- $title=$langs->trans("ProductsCategoryShort");
- if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
- elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
- elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
- elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
+ if ($result)
+ {
+ $title=$langs->trans("ProductsCategoryShort");
+ if ($type == 0) $title=$langs->trans("ProductsCategoryShort");
+ elseif ($type == 1) $title=$langs->trans("SuppliersCategoryShort");
+ elseif ($type == 2) $title=$langs->trans("CustomersCategoryShort");
+ elseif ($type == 3) $title=$langs->trans("MembersCategoryShort");
- $head = categories_prepare_head($object,$type);
- dol_fiche_head($head, 'photos', $title, 0, 'category');
+ $head = categories_prepare_head($object,$type);
+ dol_fiche_head($head, 'photos', $title, 0, 'category');
- /*
- * Confirmation de la suppression de photo
- */
- if ($action == 'delete')
- {
- $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
- if ($ret == 'html') print ' ';
- }
+ /*
+ * Confirmation de la suppression de photo
+ */
+ if ($action == 'delete')
+ {
+ $ret=$html->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
+ if ($ret == 'html') print ' ';
+ }
- print($mesg);
+ print($mesg);
- print '';
+ print '';
- // Path of category
- print '| ';
- $ways = $object->print_all_ways ();
- print $langs->trans("Ref").' | ';
- print ''.$langs->trans("Root").' >> ';
- foreach ($ways as $way)
- {
- print $way." \n";
- }
- print ' | ';
+ // Path of category
+ print '| ';
+ $ways = $object->print_all_ways();
+ print $langs->trans("Ref").' | ';
+ print ''.$langs->trans("Root").' >> ';
+ foreach ($ways as $way)
+ {
+ print $way." \n";
+ }
+ print ' | ';
- // Description
- print '| ';
- print $langs->trans("Description").' | ';
- print nl2br($object->description);
- print ' | ';
+ // Description
+ print '| ';
+ print $langs->trans("Description").' | ';
+ print nl2br($object->description);
+ print ' | ';
- // Visibility
-/* if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
- {
- if ($object->socid)
- {
- $soc = new Societe($db);
- $soc->fetch($object->socid);
+ // Visibility
+ /* if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)
+ {
+ if ($object->socid)
+ {
+ $soc = new Societe($db);
+ $soc->fetch($object->socid);
- print '| ';
- print $langs->trans("AssignedToTheCustomer").' | ';
- print $soc->getNomUrl(1);
- print ' | ';
+ print '| ';
+ print $langs->trans("AssignedToTheCustomer").' | ';
+ print $soc->getNomUrl(1);
+ print ' | ';
- $catsMeres = $object->get_meres ();
+ $catsMeres = $object->get_meres ();
- if ($catsMeres < 0)
- {
- dol_print_error();
- }
- else if (count($catsMeres) > 0)
- {
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' | ';
- }
- }
- else
- {
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' | ';
- }
- }
- else
- {
- print '| ';
- print $langs->trans("CategoryContents").' | ';
- print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
- print ' | ';
- }
-*/
+ if ($catsMeres < 0)
+ {
+ dol_print_error();
+ }
+ else if (count($catsMeres) > 0)
+ {
+ print '| ';
+ print $langs->trans("CategoryContents").' | ';
+ print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
+ print ' | ';
+ }
+ }
+ else
+ {
+ print '| ';
+ print $langs->trans("CategoryContents").' | ';
+ print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
+ print ' | ';
+ }
+ }
+ else
+ {
+ print '| ';
+ print $langs->trans("CategoryContents").' | ';
+ print ($object->visible ? $langs->trans("Visible") : $langs->trans("Invisible"));
+ print ' | ';
+ }
+ */
- print " \n";
+ print " \n";
- print "\n";
+ print "\n";
- /* ************************************************************************** */
- /* */
- /* Barre d'action */
- /* */
- /* ************************************************************************** */
+ /* ************************************************************************** */
+ /* */
+ /* Barre d'action */
+ /* */
+ /* ************************************************************************** */
- print "\n\n";
+ print "\n \n";
+ print "\n \n";
- /*
- * Ajouter une photo
- */
- if ($action == 'ajout_photo' && $user->rights->categorie->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
- {
- // Affiche formulaire upload
- $formfile=new FormFile($db);
- $formfile->form_attach_new_file(DOL_URL_ROOT.'/categories/photos.php?id='.$object->id.'&type='.$type,$langs->trans("AddPhoto"),1);
- }
+ /*
+ * Ajouter une photo
+ */
+ if ($action == 'ajout_photo' && $user->rights->categorie->creer && ! empty($conf->global->MAIN_UPLOAD_DOC))
+ {
+ // Affiche formulaire upload
+ $formfile=new FormFile($db);
+ $formfile->form_attach_new_file(DOL_URL_ROOT.'/categories/photos.php?id='.$object->id.'&type='.$type,$langs->trans("AddPhoto"),1);
+ }
- // Affiche photos
- if ($action != 'ajout_photo')
- {
- $nbphoto=0;
- $nbbyrow=5;
+ // Affiche photos
+ if ($action != 'ajout_photo')
+ {
+ $nbphoto=0;
+ $nbbyrow=5;
- $maxWidth = 160;
- $maxHeight = 120;
+ $maxWidth = 160;
+ $maxHeight = 120;
- $pdir = get_exdir($object->id,2) . $object->id ."/photos/";
- $dir = $conf->categorie->dir_output.'/'.$pdir;
+ $pdir = get_exdir($object->id,2) . $object->id ."/photos/";
+ $dir = $conf->categorie->dir_output.'/'.$pdir;
- print ' ';
- print '';
+ print ' ';
+ print '';
- }
- }
+ print ' ';
+ }
+ }
}
else
{
- print $langs->trans("ErrorUnknown");
+ print $langs->trans("ErrorUnknown");
}
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 478bd124928..c1bb3b9739d 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -82,7 +82,7 @@ if ($user->rights->categorie->supprimer && $action == 'confirm_delete' && $confi
$html = new Form($db);
-llxHeader ("","",$langs->trans("Categories"));
+llxHeader("","",$langs->trans("Categories"));
if ($mesg) print $mesg.' ';
@@ -109,7 +109,7 @@ print '';
// Path of category
print '| ';
-$ways = $object->print_all_ways ();
+$ways = $object->print_all_ways();
print $langs->trans("Ref").' | ';
print ''.$langs->trans("Root").' >> ';
foreach ($ways as $way)
@@ -168,7 +168,7 @@ else
}
print " | ";
print " \n";
- if (sizeof ($cats) > 0)
+ if (count($cats) > 0)
{
$var=true;
foreach ($cats as $cat)
@@ -217,7 +217,7 @@ if ($object->type == 0)
print "\n";
print '| '.$langs->trans("ProductsAndServices")." | \n";
- if (sizeof ($prods) > 0)
+ if (count($prods) > 0)
{
$i = 0;
$var=true;
@@ -255,7 +255,7 @@ if ($object->type == 1)
print "\n";
print "| ".$langs->trans("Suppliers")." | \n";
- if (sizeof ($socs) > 0)
+ if (count($socs) > 0)
{
$i = 0;
$var=true;
@@ -274,7 +274,7 @@ if ($object->type == 1)
}
else
{
- print "| ".$langs->trans ("ThisCategoryHasNoSupplier")." | ";
+ print "| ".$langs->trans("ThisCategoryHasNoSupplier")." | ";
}
print " \n";
}
@@ -293,7 +293,7 @@ if($object->type == 2)
print "\n";
print "| ".$langs->trans("Customers")." | \n";
- if (sizeof ($socs) > 0)
+ if (count($socs) > 0)
{
$i = 0;
$var=true;
@@ -333,7 +333,7 @@ if ($object->type == 3)
print "\n";
print '| '.$langs->trans("Member")." | \n";
- if (sizeof ($prods) > 0)
+ if (count($prods) > 0)
{
$i = 0;
$var=true;
|