/**
  * Piece of code extracted from Form::formconfirm to show a confirm dialog with a upload form
  * File input has name 'uploadfile'
  *
  * @param string $page Url of page to call if confirmation is OK
  * @param string $title Title
  * @param string $question Question
  * @param string $action Action
  * @param string $label Label of the input
  * @return string HTML code
  */
 public static function uploadForm($page, $title, $question, $action, $label)
 {
     global $langs;
     $formconfirm = "\n<!-- begin form_confirm page=" . $page . " -->\n";
     $formconfirm .= '<form method="POST" action="' . $page . '" class="notoptoleftroright" enctype="multipart/form-data">' . "\n";
     $formconfirm .= '<input type="hidden" name="action" value="' . $action . '">';
     $formconfirm .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">' . "\n";
     $formconfirm .= '<table width="100%" class="valid">' . "\n";
     // Line title
     $formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="3">' . img_picto('', 'recent') . ' ' . $title . '</td></tr>' . "\n";
     // Line form fields
     $formconfirm .= '<tr class="valid"><td class="valid" colspan="3">' . "\n";
     $formconfirm .= $label . '</td><td valign="top" colspan="2" align="left">';
     $formconfirm .= '<input type="file" name="uploadfile">';
     $formconfirm .= '</td></tr>' . "\n";
     $formconfirm .= '</td></tr>' . "\n";
     // Line with question
     $formconfirm .= '<tr class="valid">';
     $formconfirm .= '<td class="valid" colspan="3"></td>';
     $formconfirm .= '<td class="valid" colspan="2"><input class="button" type="submit" value="' . $langs->trans("Upload") . '"></td>';
     $formconfirm .= '</tr>' . "\n";
     $formconfirm .= '</table>' . "\n";
     $formconfirm .= "</form>\n";
     $formconfirm .= '<br>';
     $formconfirm .= "<!-- end form_confirm -->\n";
     return $formconfirm;
 }
function _liste()
{
    global $langs, $db, $user, $conf;
    $langs->load('asset@asset');
    llxHeader('', $langs->trans('ListControl'), '', '');
    getStandartJS();
    if (isset($_SESSION['AssetMsg'])) {
        print_r('<div class="info">' . $langs->trans($_SESSION['AssetMsg']) . '</div>');
        unset($_SESSION['AssetMsg']);
    }
    $form = new TFormCore();
    $assetControl = new TAssetControl();
    $r = new TSSRenderControler($assetControl);
    $sql = 'SELECT rowid as id, libelle, type, question, "" as action FROM ' . MAIN_DB_PREFIX . 'asset_control';
    $THide = array('id');
    $form = new TFormCore($_SERVER['PHP_SELF'], 'form', 'GET');
    $ATMdb = new TPDOdb();
    $r->liste($ATMdb, $sql, array('limit' => array('nbLine' => '30'), 'subQuery' => array(), 'link' => array('libelle' => '<a href="' . DOL_URL_ROOT . '/custom/asset/control.php?id=@id@">' . img_picto('', 'object_generic.png', '', 0) . '@val@</a>', 'question' => '<a href="' . DOL_URL_ROOT . '/custom/asset/control.php?id=@id@">@val@</a>', 'action' => '<a title="Modifier" href="control.php?id=@id@&action=edit">' . img_picto('', 'edit.png', '', 0) . '</a>&nbsp;&nbsp;&nbsp;<a title="Supprimer" onclick="if (!window.confirm(\'Confirmez-vous la suppression ?\')) return false;" href="control.php?id=@id@&action=delete">' . img_picto('', 'delete.png', '', 0) . "</a>"), 'search' => array('libelle' => array('recherche' => true, 'table' => '')), 'translate' => array(), 'hide' => $THide, 'liste' => array('titre' => $langs->trans('ListControl'), 'image' => img_picto('', 'title.png', '', 0), 'picto_precedent' => img_picto('', 'back.png', '', 0), 'picto_suivant' => img_picto('', 'next.png', '', 0), 'noheader' => 0, 'messageNothing' => $langs->trans('AssetEmptyControl'), 'picto_search' => img_picto('', 'search.png', '', 0)), 'title' => array('libelle' => 'Libelle', 'type' => 'Type', 'nb_value' => 'Nombre de valeurs associés', 'question' => 'Question', 'action' => 'Action'), 'eval' => array('type' => 'TAssetControl::$TType["@val@"]')));
    $form->end();
    echo '<div class="tabsAction">';
    echo '<a class="butAction" href="control.php?action=new">' . $langs->trans('AssetCreateControl') . '</a>';
    echo '</div>';
    $ATMdb->close();
    llxFooter('');
}
 private function init(&$TParam)
 {
     if (!isset($TParam['hide'])) {
         $TParam['hide'] = array();
     }
     if (!isset($TParam['link'])) {
         $TParam['link'] = array();
     }
     if (!isset($TParam['subQuery'])) {
         $TParam['subQuery'] = array();
     }
     if (!isset($TParam['type'])) {
         $TParam['type'] = array();
     }
     if (!isset($TParam['orderby']['noOrder'])) {
         $TParam['orderby']['noOrder'] = array();
     }
     if (!isset($TParam['node'])) {
         $TParam['node'] = array('main' => 'data', 'object' => 'dataline');
     }
     if (!isset($TParam['liste'])) {
         $TParam['liste'] = array();
     }
     $TParam['liste'] = array_merge(array('messageNothing' => "Il n'y a aucun élément à afficher.", 'picto_precedent' => '&lt;', 'picto_suivant' => '&gt;', 'order_down' => img_down(), 'order_up' => img_up(), 'noheader' => 0, 'image' => '', 'titre' => 'Liste', 'orderDown' => '', 'orderUp' => '', 'id' => $this->id, 'picto_search' => img_picto('Search', 'search.png'), 'head_search' => '', 'export' => array()), $TParam['liste']);
     if (!isset($TParam['limit'])) {
         $TParam['limit'] = array();
     }
     if (!empty($_REQUEST['TListTBS'][$this->id]['page'])) {
         $TParam['limit']['page'] = $_REQUEST['TListTBS'][$this->id]['page'];
     }
     $TParam['limit'] = array_merge(array('page' => 1, 'nbLine' => 30), $TParam['limit']);
     if (!empty($_REQUEST['TListTBS'][$this->id]['orderBy'])) {
         /*
         	$TParam['orderBy'] = array();	
         				foreach($_REQUEST['TListTBS'][$this->id]['orderBy'] as $asc=>$field) {
         					$TParam['orderBy'][$field]=$asc;
         				}
         */
         $TParam['orderBy'] = $_REQUEST['TListTBS'][$this->id]['orderBy'];
     }
     //	print_r($TParam);
 }
Beispiel #4
0
/**
 * Show information with URLs to launch jobs
 *
 * @return	int			0
 */
function dol_print_cron_urls()
{
    global $conf, $langs, $user;
    global $dolibarr_main_url_root;
    // Define $urlwithroot
    $urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
    $urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
    // This is to use external domain name found into config file
    //$urlwithroot=DOL_MAIN_URL_ROOT;					// This is to use same domain name than current
    // Cron launch
    print '<u>' . $langs->trans("URLToLaunchCronJobs") . ':</u><br>';
    $url = $urlwithroot . '/public/cron/cron_run_jobs.php?' . (empty($conf->global->CRON_KEY) ? '' : 'securitykey=' . $conf->global->CRON_KEY . '&') . 'userlogin='******'', 'object_globe.png') . ' <a href="' . $url . '" target="_blank">' . $url . "</a><br>\n";
    print ' ' . $langs->trans("OrToLaunchASpecificJob") . '<br>';
    $url = $urlwithroot . '/public/cron/cron_run_jobs.php?' . (empty($conf->global->CRON_KEY) ? '' : 'securitykey=' . $conf->global->CRON_KEY . '&') . 'userlogin='******'&id=cronjobid';
    print img_picto('', 'object_globe.png') . ' <a href="' . $url . '" target="_blank">' . $url . "</a><br>\n";
    print '<br>';
    print '<u>' . $langs->trans("FileToLaunchCronJobs") . ':</u><br>';
    $file = '/scripts/cron/cron_run_jobs.php' . ' ' . (empty($conf->global->CRON_KEY) ? 'securitykey' : '' . $conf->global->CRON_KEY . '') . ' ' . $user->login . ' [cronjobid]';
    print '<textarea rows="' . ROWS_2 . '" cols="120">..' . $file . "</textarea><br>\n";
    print '<br>';
    // Add note
    $linuxlike = 1;
    if (preg_match('/^win/i', PHP_OS)) {
        $linuxlike = 0;
    }
    if (preg_match('/^mac/i', PHP_OS)) {
        $linuxlike = 0;
    }
    print $langs->trans("Note") . ': ';
    if ($linuxlike) {
        print $langs->trans("CronExplainHowToRunUnix");
        print '<br>';
        print '<textarea rows="' . ROWS_1 . '" style="width:80%">*/5 * * * * pathtoscript/scripts/cron/cron_run_jobs.php ' . (empty($conf->global->CRON_KEY) ? 'securitykey' : '' . $conf->global->CRON_KEY . '') . ' ' . $user->login . ' &gt; ' . DOL_DOCUMENT_ROOT . '/cron_run_jobs.php.log</textarea><br>';
    } else {
        print $langs->trans("CronExplainHowToRunWin");
    }
    return 0;
}
     $totalvalue += price2num($objp->pmp * $objp->value, 'MT');
     // Price sell min
     if (empty($conf->global->PRODUIT_MULTIPRICES)) {
         $pricemin = $objp->price;
         print '<td align="right">';
         print price(price2num($pricemin, 'MU'), 1);
         print '</td>';
         // Total sell min
         print '<td align="right">';
         print price(price2num($pricemin * $objp->value, 'MT'), 1);
         print '</td>';
     }
     $totalvaluesell += price2num($pricemin * $objp->value, 'MT');
     if ($user->rights->stock->mouvement->creer) {
         print '<td align="center"><a href="' . DOL_URL_ROOT . '/product/stock/product.php?dwid=' . $object->id . '&amp;id=' . $objp->rowid . '&amp;action=transfert">';
         print img_picto($langs->trans("StockMovement"), 'uparrow.png') . ' ' . $langs->trans("StockMovement");
         print "</a></td>";
     }
     if ($user->rights->stock->creer) {
         print '<td align="center"><a href="' . DOL_URL_ROOT . '/product/stock/product.php?dwid=' . $object->id . '&amp;id=' . $objp->rowid . '&amp;action=correction">';
         print $langs->trans("StockCorrection");
         print "</a></td>";
     }
     print "</tr>";
     $i++;
 }
 $db->free($resql);
 print '<tr class="liste_total"><td class="liste_total" colspan="2">' . $langs->trans("Total") . '</td>';
 print '<td class="liste_total" align="right">' . $totalunit . '</td>';
 print '<td class="liste_total">&nbsp;</td>';
 print '<td class="liste_total" align="right">' . price(price2num($totalvalue, 'MT')) . '</td>';
     print '<td align="center">' . "\n";
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&value=' . $name . '">';
     print img_picto($langs->trans("Enabled"), 'switch_on');
     print '</a>';
     print '</td>';
 } else {
     print '<td align="center">' . "\n";
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
     print "</td>";
 }
 // Defaut
 print '<td align="center">';
 if ($conf->global->COMMANDE_ADDON_PDF == $name) {
     print img_picto($langs->trans("Default"), 'on');
 } else {
     print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&amp;scandir=' . $module->scandir . '&amp;label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
 }
 print '</td>';
 // Info
 $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name;
 $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown"));
 if ($module->type == 'pdf') {
     $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur;
 }
 $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>';
 $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1);
 $htmltooltip .= '<br>' . $langs->trans("PaymentMode") . ': ' . yn($module->option_modereg, 1, 1);
 $htmltooltip .= '<br>' . $langs->trans("PaymentConditions") . ': ' . yn($module->option_condreg, 1, 1);
 $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1);
 //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
 //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
Beispiel #7
0
     }
     print price($amount[$key]);
     print '</a>';
     print '</td>';
     // Percent;
     print '<td align="right">' . ($catotal > 0 ? round(100 * $amount[$key] / $catotal, 2) . '%' : '&nbsp;') . '</td>';
     // Other stats
     print '<td align="center">';
     if (!empty($conf->propal->enabled) && $key > 0) {
         print '&nbsp;<a href="' . DOL_URL_ROOT . '/comm/propal/stats/index.php?socid=' . $key . '">' . img_picto($langs->trans("ProposalStats"), "stats") . '</a>&nbsp;';
     }
     if (!empty($conf->commande->enabled) && $key > 0) {
         print '&nbsp;<a href="' . DOL_URL_ROOT . '/commande/stats/index.php?socid=' . $key . '">' . img_picto($langs->trans("OrderStats"), "stats") . '</a>&nbsp;';
     }
     if (!empty($conf->facture->enabled) && $key > 0) {
         print '&nbsp;<a href="' . DOL_URL_ROOT . '/compta/facture/stats/index.php?socid=' . $key . '">' . img_picto($langs->trans("InvoiceStats"), "stats") . '</a>&nbsp;';
     }
     print '</td>';
     print "</tr>\n";
     $i++;
 }
 // Total
 print '<tr class="liste_total">';
 print '<td>' . $langs->trans("Total") . '</td>';
 if ($modecompta != 'CREANCES-DETTES') {
     print '<td colspan="1"></td>';
 } else {
     print '<td align="right">' . price($catotal_ht) . '</td>';
 }
 print '<td align="right">' . price($catotal) . '</td>';
 print '<td>&nbsp;</td>';
Beispiel #8
0
 $var = !$var;
 print '<tr ' . $bc[$var] . '>';
 print '<td class="nowrap">';
 $objectstatic->id = $objp->propalid;
 $objectstatic->ref = $objp->ref;
 print '<table class="nobordernopadding"><tr class="nocellnopadd">';
 print '<td class="nobordernopadding nowrap">';
 print $objectstatic->getNomUrl(1);
 print '</td>';
 print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
 if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < $now - $conf->propal->cloture->warning_delay) {
     print img_warning($langs->trans("Late"));
 }
 if (!empty($objp->note_private)) {
     print ' <span class="note">';
     print '<a href="' . DOL_URL_ROOT . '/comm/propal/note.php?id=' . $objp->propalid . '">' . img_picto($langs->trans("ViewPrivateNote"), 'object_generic') . '</a>';
     print '</span>';
 }
 print '</td>';
 // Ref
 print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
 $filename = dol_sanitizeFileName($objp->ref);
 $filedir = $conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
 $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $objp->propalid;
 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
 print '</td></tr></table>';
 print "</td>\n";
 // Customer ref
 print '<td class="nocellnopadd nowrap">';
 print $objp->ref_client;
 print '</td>';
Beispiel #9
0
	/**
	 *    	Return label of a contract line status
	 *    	@param      statut      id statut
	 *		@param      mode        0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
	 *		@param		expired		0=Not expired, 1=Expired, -1=Both or unknown
	 *    	@return     string      Libelle
	 */
	function LibStatut($statut,$mode,$expired=-1)
	{
		global $langs;
		$langs->load("contracts");
		if ($mode == 0)
		{
			if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
			if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
			if ($statut == 4 && $expired == 0)  { return $langs->trans("ServiceStatusNotLate"); }
			if ($statut == 4 && $expired == 1)  { return $langs->trans("ServiceStatusLate"); }
			if ($statut == 5) { return $langs->trans("ServiceStatusClosed");  }
		}
		if ($mode == 1)
		{
			if ($statut == 0) { return $langs->trans("ServiceStatusInitial"); }
			if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning"); }
			if ($statut == 4 && $expired == 0)  { return $langs->trans("ServiceStatusNotLateShort"); }
			if ($statut == 4 && $expired == 1)  { return $langs->trans("ServiceStatusLateShort"); }
			if ($statut == 5) { return $langs->trans("ServiceStatusClosed");  }
		}
		if ($mode == 2)
		{
			if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
			if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
			if ($statut == 4 && $expired == 0)  { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLateShort"); }
			if ($statut == 4 && $expired == 1)  { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLateShort"); }
			if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
		}
		if ($mode == 3)
		{
			if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
			if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
			if ($statut == 4 && $expired == 0)  { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4'); }
			if ($statut == 4 && $expired == 1)  { return img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
			if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
		}
		if ($mode == 4)
		{
			if ($statut == 0) { return img_picto($langs->trans('ServiceStatusInitial'),'statut0').' '.$langs->trans("ServiceStatusInitial"); }
			if ($statut == 4 && $expired == -1) { return img_picto($langs->trans('ServiceStatusRunning'),'statut4').' '.$langs->trans("ServiceStatusRunning"); }
			if ($statut == 4 && $expired == 0)  { return img_picto($langs->trans('ServiceStatusNotLate'),'statut4').' '.$langs->trans("ServiceStatusNotLate"); }
			if ($statut == 4 && $expired == 1)  { return img_picto($langs->trans('ServiceStatusLate'),'statut3').' '.$langs->trans("ServiceStatusLate"); }
			if ($statut == 5) { return img_picto($langs->trans('ServiceStatusClosed'),'statut6') .' '.$langs->trans("ServiceStatusClosed"); }
		}
		if ($mode == 5)
		{
			if ($statut == 0) { return $langs->trans("ServiceStatusInitial").' '.img_picto($langs->trans('ServiceStatusInitial'),'statut0'); }
			if ($statut == 4 && $expired == -1) { return $langs->trans("ServiceStatusRunning").' '.img_picto($langs->trans('ServiceStatusRunning'),'statut4'); }
			if ($statut == 4 && $expired == 0)  { return $langs->trans("ServiceStatusNotLateShort").' '.img_picto($langs->trans('ServiceStatusNotLateShort'),'statut4'); }
			if ($statut == 4 && $expired == 1)  { return $langs->trans("ServiceStatusLateShort").' '.img_picto($langs->trans('ServiceStatusLate'),'statut3'); }
			if ($statut == 5) { return $langs->trans("ServiceStatusClosed").' '.img_picto($langs->trans('ServiceStatusClosed'),'statut6'); }
		}
	}
Beispiel #10
0
 /**
  *	Return status label for an object
  *
  *	@param	int			$statut	  	Id statut
  *	@param	integer		$mode		0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
  * 	@return	string	  				Label
  */
 function LibStatut($statut, $mode = 0)
 {
     // list of Statut of the task
     $this->statuts[0] = 'Draft';
     $this->statuts[1] = 'Validated';
     $this->statuts[2] = 'Running';
     $this->statuts[3] = 'Finish';
     $this->statuts[4] = 'Transfered';
     $this->statuts_short[0] = 'Draft';
     $this->statuts_short[1] = 'Validated';
     $this->statuts_short[2] = 'Running';
     $this->statuts_short[3] = 'Finish';
     $this->statuts_short[4] = 'Transfered';
     global $langs;
     if ($mode == 0) {
         return $langs->trans($this->statuts[$statut]);
     }
     if ($mode == 1) {
         return $langs->trans($this->statuts_short[$statut]);
     }
     if ($mode == 2) {
         if ($statut == 0) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
         if ($statut == 1) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
         if ($statut == 2) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
         if ($statut == 3) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
         if ($statut == 4) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
         if ($statut == 5) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5') . ' ' . $langs->trans($this->statuts_short[$statut]);
         }
     }
     if ($mode == 3) {
         if ($statut == 0) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
         }
         if ($statut == 1) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1');
         }
         if ($statut == 2) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3');
         }
         if ($statut == 3) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
         }
         if ($statut == 4) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
         }
         if ($statut == 5) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5');
         }
     }
     if ($mode == 4) {
         if ($statut == 0) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 1) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 2) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 3) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 4) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 5) {
             return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5') . ' ' . $langs->trans($this->statuts[$statut]);
         }
     }
     if ($mode == 5) {
         if ($statut == 0) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut0');
         }
         if ($statut == 1) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1');
         }
         if ($statut == 2) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3');
         }
         if ($statut == 3) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4');
         }
         if ($statut == 4) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6');
         }
         if ($statut == 5) {
             return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5');
         }
     }
 }
 /**
  *  Return label of a status
  *
  * 	@param  int		$statut		Id statut
  *  @param  int		$mode       0=Long label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Long label, 5=Short label + Picto
  *  @return string				Label of status
  */
 function LibStatut($statut, $mode = 0)
 {
     global $langs;
     $langs->load('orders');
     if ($mode == 0) {
         return $langs->trans($this->statuts[$statut]);
     }
     if ($mode == 1) {
         return $langs->trans($this->statutshort[$statut]);
     }
     if ($mode == 2) {
         return $langs->trans($this->statuts[$statut]);
     }
     if ($mode == 3) {
         if ($statut == 0) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut0');
         }
         if ($statut == 1) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut4');
         }
         if ($statut == 2) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut8');
         }
     }
     if ($mode == 4) {
         if ($statut == 0) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut0') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 1) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut4') . ' ' . $langs->trans($this->statuts[$statut]);
         }
         if ($statut == 2) {
             return img_picto($langs->trans($this->statuts[$statut]), 'statut8') . ' ' . $langs->trans($this->statuts[$statut]);
         }
     }
     if ($mode == 5) {
         if ($statut == 0) {
             return '<span class="hideonsmartphone">' . $langs->trans($this->statutshort[$statut]) . ' </span>' . img_picto($langs->trans($this->statuts[$statut]), 'statut0');
         }
         if ($statut == 1) {
             return '<span class="hideonsmartphone">' . $langs->trans($this->statutshort[$statut]) . ' </span>' . img_picto($langs->trans($this->statuts[$statut]), 'statut4');
         }
         if ($statut == 2) {
             return '<span class="hideonsmartphone">' . $langs->trans($this->statutshort[$statut]) . ' </span>' . img_picto($langs->trans($this->statuts[$statut]), 'statut8');
         }
     }
 }
Beispiel #12
0
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$langs->load("errors");
$langs->load("admin");
$langs->load("companies");
$langs->load("resource");
$action = GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view';
$confirm = GETPOST('confirm', 'alpha');
$id = GETPOST('id', 'int');
$rowid = GETPOST('rowid', 'alpha');
if (!$user->admin) {
    accessforbidden();
}
$acts[0] = "activate";
$acts[1] = "disable";
$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off');
$actl[1] = img_picto($langs->trans("Activated"), 'switch_on');
$listoffset = GETPOST('listoffset');
$listlimit = GETPOST('listlimit') > 0 ? GETPOST('listlimit') : 1000;
$active = 1;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
$page = GETPOST("page", 'int');
if ($page == -1) {
    $page = 0;
}
$offset = $listlimit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('admin'));
// This page is a generic page to edit dictionaries
Beispiel #13
0
    $var = true;
    print '<tr class="liste_titre">';
    print '<th>' . $langs->trans("User") . '</th>';
    print '<th>' . $langs->trans("PrintModule") . '</th>';
    print '<th>' . $langs->trans("PrintDriver") . '</th>';
    print '<th>' . $langs->trans("Printer") . '</th>';
    print '<th>' . $langs->trans("PrinterLocation") . '</th>';
    print '<th>' . $langs->trans("PrinterId") . '</th>';
    print '<th>' . $langs->trans("NumberOfCopy") . '</th>';
    print '<th class="center">' . $langs->trans("Delete") . '</th>';
    print "</tr>\n";
    $sql = 'SELECT p.rowid, p.printer_name, p.printer_location, p.printer_id, p.copy, p.module, p.driver, p.userid, u.login FROM ' . MAIN_DB_PREFIX . 'printing as p, ' . MAIN_DB_PREFIX . 'user as u WHERE p.userid=u.rowid';
    $resql = $db->query($sql);
    while ($row = $db->fetch_array($resql)) {
        $var = !$var;
        print '<tr ' . $bc[$var] . '>';
        print '<td>' . $row['login'] . '</td>';
        print '<td>' . $row['module'] . '</td>';
        print '<td>' . $row['driver'] . '</td>';
        print '<td>' . $row['printer_name'] . '</td>';
        print '<td>' . $row['printer_location'] . '</td>';
        print '<td>' . $row['printer_id'] . '</td>';
        print '<td>' . $row['copy'] . '</td>';
        print '<td class="center">' . img_picto($langs->trans("Delete"), 'delete') . '</td>';
        print "</tr>\n";
    }
    print '</table>';
    dol_fiche_end();
}
llxFooter();
$db->close();
Beispiel #14
0
 $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'paiement_facture as pf ON f.rowid=pf.fk_facture';
 $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = " . $objsoc->id;
 $sql .= ' GROUP BY f.rowid, f.facnumber, f.type, f.amount, f.total, f.total_ttc,';
 $sql .= ' f.datef, f.datec, f.paye, f.fk_statut,';
 $sql .= ' s.nom, s.rowid';
 $sql .= " ORDER BY f.datef DESC, f.datec DESC";
 $resql = $db->query($sql);
 if ($resql) {
     $var = true;
     $num = $db->num_rows($resql);
     $i = 0;
     if ($num > 0) {
         $tableaushown = 1;
         print '<tr class="liste_titre">';
         print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>' . $langs->trans("LastCustomersBills", $num <= $MAXLIST ? "" : $MAXLIST) . '</td><td align="right"><a href="' . DOL_URL_ROOT . '/compta/facture.php?socid=' . $objsoc->id . '">' . $langs->trans("AllBills") . ' (' . $num . ')</a></td>';
         print '<td width="20px" align="right"><a href="' . DOL_URL_ROOT . '/compta/facture/stats/index.php?socid=' . $objsoc->id . '">' . img_picto($langs->trans("Statistics"), 'stats') . '</a></td>';
         print '</tr></table></td>';
         print '</tr>';
     }
     while ($i < $num && $i < $MAXLIST) {
         $objp = $db->fetch_object($resql);
         $var = !$var;
         print "<tr {$bc[$var]}>";
         print '<td>';
         $facturestatic->id = $objp->facid;
         $facturestatic->ref = $objp->facnumber;
         $facturestatic->type = $objp->type;
         print $facturestatic->getNomUrl(1);
         print '</td>';
         if ($objp->df > 0) {
             print "<td align=\"right\">" . dol_print_date($db->jdate($objp->df), 'day') . "</td>\n";
Beispiel #15
0
    /**
     *      Renvoi le libelle d'un statut donne
     *      @param      statut          Id statut
     *      @param      mode            0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
     *      @return     string          Libelle du statut
     */
    function LibStatut($statut,$mode=0)
    {
        global $langs;
        $langs->load('companies');

        if ($mode == 0)
        {
            if ($statut==0) return $langs->trans("ActivityCeased");
            if ($statut==1) return $langs->trans("InActivity");
        }
        if ($mode == 1)
        {
            if ($statut==0) return $langs->trans("ActivityCeased");
            if ($statut==1) return $langs->trans("InActivity");
        }
        if ($mode == 2)
        {
            if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut6').' '.$langs->trans("ActivityCeased");
            if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity");
        }
        if ($mode == 3)
        {
            if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut6');
            if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4');
        }
        if ($mode == 4)
        {
            if ($statut==0) return img_picto($langs->trans("ActivityCeased"),'statut6').' '.$langs->trans("ActivityCeased");
            if ($statut==1) return img_picto($langs->trans("InActivity"),'statut4').' '.$langs->trans("InActivity");
        }
        if ($mode == 5)
        {
            if ($statut==0) return $langs->trans("ActivityCeased").' '.img_picto($langs->trans("ActivityCeased"),'statut6');
            if ($statut==1) return $langs->trans("InActivity").' '.img_picto($langs->trans("InActivity"),'statut4');
        }
    }
Beispiel #16
0
    print "<a class='butAction' href='edit.php?id=" . $object->id . $socid . "&amp;type=" . $type . "'>" . $langs->trans("Modify") . "</a>";
}
if ($user->rights->categorie->supprimer) {
    print "<a class='butActionDelete' href='" . DOL_URL_ROOT . "/categories/viewcat.php?action=delete&amp;id=" . $object->id . "&amp;type=" . $type . "'>" . $langs->trans("Delete") . "</a>";
}
print "</div>";
$cats = $object->get_filles();
if ($cats < 0) {
    dol_print_error($db, $cats->error, $cats->errors);
} else {
    print "<br>";
    print "<table class='noborder' width='100%'>\n";
    print "<tr class='liste_titre'><td colspan='2'>" . $langs->trans("SubCats") . '</td><td align="right">';
    if ($user->rights->categorie->creer) {
        print "<a href='" . DOL_URL_ROOT . "/categories/card.php?action=create&amp;catorigin=" . $object->id . "&amp;socid=" . $object->socid . "&amp;type=" . $type . "&amp;urlfrom=" . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&type=' . $type) . "'>";
        print img_picto($langs->trans("Create"), 'filenew');
        print "</a>";
    }
    print "</td>";
    print "</tr>\n";
    if (count($cats) > 0) {
        $var = true;
        foreach ($cats as $cat) {
            $var = !$var;
            print "\t<tr " . $bc[$var] . ">\n";
            print "\t\t" . '<td class="nowrap">';
            print "<a href='viewcat.php?id=" . $cat->id . "&amp;type=" . $type . "'>" . $cat->label . "</a>";
            print "</td>\n";
            print "\t\t" . '<td colspan="2">' . $cat->description . "</td>\n";
            /*
            if ($cat->visible == 1)
Beispiel #17
0
                if ($conf->use_javascript_ajax)
                {
                    print "\n";
                    print '<script language="JavaScript" type="text/javascript">';
                    print "function CheckVAT(a) {\n";
                    print "newpopup('".DOL_URL_ROOT."/societe/checkvat/checkVatPopup.php?vatNumber='+a,'".dol_escape_js($langs->trans("VATIntraCheckableOnEUSite"))."',500,285);\n";
                    print "}\n";
                    print '</script>';
                    print "\n";
                    $s.='<a href="#" onclick="javascript: CheckVAT( $(\'#tva_intra\').val() );">'.$langs->trans("VATIntraCheck").'</a>';
                    $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
                }
                else
                {
                    $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->id_pays).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
                }
            }
            print $s;
        }
        else
        {
            print '&nbsp;';
        }
        print '</td>';
        print '</tr>';

        // Local Taxes
        // TODO add specific function by country
        if($mysoc->country_code=='ES')
        {
Beispiel #18
0
 print '</td>';
 print '<td width="20">&nbsp;</td>';
 print '</tr>';
 // Hide unauthorized button
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("ButtonHideUnauthorized") . '</td><td colspan="2">';
 print yn(isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
 print '</td></tr>';
 // Link to help center
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DisableLinkToHelpCenter") . '</td><td colspan="2">';
 print yn(isset($conf->global->MAIN_HELPCENTER_DISABLELINK) ? $conf->global->MAIN_HELPCENTER_DISABLELINK : 0, 1);
 print '</td></tr>';
 // Link to wiki help
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("DisableLinkToHelp", img_picto('', DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/helpdoc.png', '', 1)) . '</td><td colspan="2">';
 print yn(isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
 print '</td></tr>';
 // Show bugtrack link
 $var = !$var;
 print '<tr ' . $bc[$var] . '"><td width="35%">' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . '</td><td>';
 print yn($conf->global->MAIN_BUGTRACK_ENABLELINK) . "</td>";
 print '<td width="20">&nbsp;</td>';
 print "</tr>";
 // Message login
 $var = !$var;
 print '<tr ' . $bc[$var] . '><td width="35%">' . $langs->trans("MessageLogin") . '</td><td colspan="2">';
 if (isset($conf->global->MAIN_HOME)) {
     print dol_htmlcleanlastbr($conf->global->MAIN_HOME);
 } else {
     print '&nbsp;';
}
if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"])) {
    $bankcheque = new Account($db);
    $bankcheque->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]);
    $bankchequeLink = $bankcheque->getNomUrl(1);
}
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && !empty($conf->stock->enabled)) {
    $warehouse = new Entrepot($db);
    $warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]);
    $warehouseLink = $warehouse->getNomUrl(1);
}
$langs->load("cashdesk");
$langs->load("main");
print '<div class="menu_bloc">';
print '<ul class="menu">';
// Link to new sell
print '<li class="menu_choix1"><a href="affIndex.php?menu=facturation&id=NOUV"><span>' . $langs->trans("NewSell") . '</span></a></li>';
// Open new tab on backoffice (this is not a disconnect from POS)
print '<li class="menu_choix2"><a href=".." target="backoffice"><span>' . $langs->trans("BackOffice") . '</span></a></li>';
// Disconnect
print '<li class="menu_choix0">' . $langs->trans("User") . ': ' . $_SESSION['firstname'] . ' ' . $_SESSION['lastname'];
print ' <a href="deconnexion.php">' . img_picto($langs->trans('Logout'), 'logout.png') . '</a><br>';
print $langs->trans("CashDeskThirdParty") . ': ' . $companyLink . '<br>';
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && !empty($conf->stock->enabled)) {
    print $langs->trans("CashDeskWarehouse") . ': ' . $warehouseLink;
}
print '</li></ul>';
print '</div>';
Beispiel #20
0
print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup');
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Description") . '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">' . $langs->trans("Value") . '</td>' . "\n";
print '</tr>';
$var = true;
$form = new Form($db);
// Mail required for members
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td>' . $langs->trans("ECMAutoTree") . '</td>';
print '<td align="center" width="20">&nbsp;</td>';
print '<td align="center" width="100">';
if ($conf->use_javascript_ajax) {
    print ajax_constantonoff('ECM_AUTO_TREE_ENABLED');
} else {
    if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
        print '<a href="' . $_SERVER['PHP_SELF'] . '?action=set_ECM_AUTO_TREE_ENABLED">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
    } else {
        if (!empty($conf->global->USER_MAIL_REQUIRED)) {
            print '<a href="' . $_SERVER['PHP_SELF'] . '?action=del_ECM_AUTO_TREE_ENABLED">' . img_picto($langs->trans("Enabled"), 'on') . '</a>';
        }
    }
}
print '</td></tr>';
print '</table>';
llxFooter();
$db->close();
Beispiel #21
0
                 print '<a title=' . $langs->trans("None") . ' alt=' . $langs->trans("None") . ' href="perms.php?id=' . $fgroup->id . '&amp;action=delrights&amp;module=' . $obj->module . '#' . $objMod->getName() . '">' . $langs->trans("None") . "</a>";
                 print '</td>';
                 print '<td colspan="2">&nbsp;</td>';
                 print '</tr>';
             }
         }
         print '<tr ' . $bc[$var] . '>';
         // Module
         print '<td class="nowrap">' . img_object('', $picto) . ' ' . $objMod->getName() . '</td>';
         if (in_array($obj->id, $permsgroup)) {
             // Own permission by group
             if ($caneditperms) {
                 print '<td align="center"><a href="perms.php?id=' . $fgroup->id . '&amp;action=delrights&amp;rights=' . $obj->id . '#' . $objMod->getName() . '">' . img_edit_remove($langs->trans("Remove")) . '</a></td>';
             }
             print '<td align="center">';
             print img_picto($langs->trans("Active"), 'tick');
             print '</td>';
         } else {
             // Do not own permission
             if ($caneditperms) {
                 print '<td align="center"><a href="perms.php?id=' . $fgroup->id . '&amp;action=addrights&amp;rights=' . $obj->id . '#' . $objMod->getName() . '">' . img_edit_add($langs->trans("Add")) . '</a></td>';
             }
             print '<td>&nbsp</td>';
         }
         $perm_libelle = $conf->global->MAIN_USE_ADVANCED_PERMS && $langs->trans("PermissionAdvanced" . $obj->id) != "PermissionAdvanced" . $obj->id ? $langs->trans("PermissionAdvanced" . $obj->id) : ($langs->trans("Permission" . $obj->id) != "Permission" . $obj->id ? $langs->trans("Permission" . $obj->id) : $obj->libelle);
         print '<td>' . $perm_libelle . '</td>';
         print '</tr>';
         $i++;
     }
 }
 print '</table>';
Beispiel #22
0
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 print '<input type="hidden" name="action" value="show_day">';
 print '<input type="hidden" name="year" value="' . dol_print_date($object->datep, '%Y') . '">';
 print '<input type="hidden" name="month" value="' . dol_print_date($object->datep, '%m') . '">';
 print '<input type="hidden" name="day" value="' . dol_print_date($object->datep, '%d') . '">';
 //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
 print img_picto($langs->trans("ViewCal"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"') . ' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewday" value="' . $langs->trans("ViewDay") . '">';
 print '</form>' . "\n";
 print '<form name="listactionsfilterperuser" action="' . DOL_URL_ROOT . '/comm/action/peruser.php" method="POST" style="float: left; padding-right: 10px;">';
 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
 print '<input type="hidden" name="action" value="show_peruser">';
 print '<input type="hidden" name="year" value="' . dol_print_date($object->datep, '%Y') . '">';
 print '<input type="hidden" name="month" value="' . dol_print_date($object->datep, '%m') . '">';
 print '<input type="hidden" name="day" value="' . dol_print_date($object->datep, '%d') . '">';
 //print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
 print img_picto($langs->trans("ViewCal"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"') . ' <input type="submit" style="min-width: 120px" class="button buttonactionview" name="viewperuser" value="' . $langs->trans("ViewPerUser") . '">';
 print '</form>' . "\n";
 print '</div>';
 if (empty($conf->global->AGENDA_DISABLE_BUILDDOC)) {
     print '<div style="clear:both;">&nbsp;<br><br></div><div class="fichecenter"><div class="fichehalfleft">';
     print '<a name="builddoc"></a>';
     // ancre
     /*
      * Documents generes
      */
     $filedir = $conf->agenda->multidir_output[$conf->entity] . '/' . $object->id;
     $urlsource = $_SERVER["PHP_SELF"] . "?socid=" . $object->id;
     $genallowed = $user->rights->agenda->myactions->create;
     $delallowed = $user->rights->agenda->myactions->delete;
     $var = true;
     $somethingshown = $formfile->show_documents('agenda', $object->id, $filedir, $urlsource, $genallowed, $delallowed, '', 0, 0, 0, 0, 0, '', '', '', $object->default_lang);
Beispiel #23
0
print $form->showrefnav($contact, 'id', $linkback);
print '</td></tr>';
// Name
print '<tr><td width="20%">' . $langs->trans("Lastname") . ' / ' . $langs->trans("Label") . '</td><td>' . $contact->lastname . '</td>';
print '<td width="20%">' . $langs->trans("Firstname") . '</td><td width="25%">' . $contact->firstname . '</td></tr>';
// Company
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) {
    if ($contact->socid > 0) {
        $objsoc = new Societe($db);
        $objsoc->fetch($contact->socid);
        print '<tr><td width="15%">' . $langs->trans("ThirdParty") . '</td><td colspan="3">' . $objsoc->getNomUrl(1) . '</td></tr>';
    } else {
        print '<tr><td width="15%">' . $langs->trans("ThirdParty") . '</td><td colspan="3">';
        print $langs->trans("ContactNotLinkedToCompany");
        print '</td></tr>';
    }
}
// Civility
print '<tr><td>' . $langs->trans("UserTitle") . '</td><td colspan="3">';
print $contact->getCivilityLabel();
print '</td></tr>';
print '</table>';
print '</div>';
print '<br>';
print $langs->trans("ExportCardToFormat") . ': ';
print '<a href="' . DOL_URL_ROOT . '/contact/vcard.php?id=' . $contact->id . '">';
print img_picto($langs->trans("VCard"), 'vcard.png') . ' ';
print $langs->trans("VCard");
print '</a>';
$db->close();
llxFooter();
    /**
     *  Load data into info_box_contents array to show array later.
     *
     *  @param	int		$max        Maximum number of records to load
     *  @return	void
     */
    function loadBox($max = 5)
    {
        global $conf, $user, $langs, $db;
        $this->max = $max;
        $refreshaction = 'refresh_' . $this->boxcode;
        include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
        $text = $langs->trans("BoxSuppliersInvoicesPerMonth", $max);
        $this->info_box_head = array('text' => $text, 'limit' => dol_strlen($text), 'graph' => 1, 'sublink' => '', 'subtext' => $langs->trans("Filter"), 'subpicto' => 'filter.png', 'subclass' => 'linkobject', 'target' => 'none');
        $dir = '';
        // We don't need a path because image file will not be saved into disk
        $prefix = '';
        $socid = 0;
        if ($user->societe_id) {
            $socid = $user->societe_id;
        }
        if (!$user->rights->societe->client->voir || $socid) {
            $prefix .= 'private-' . $user->id . '-';
        }
        // If user has no permission to see all, output dir is specific to user
        if ($user->rights->fournisseur->facture->lire) {
            $param_year = 'DOLUSERCOOKIE_box_' . $this->boxcode . '_year';
            $param_shownb = 'DOLUSERCOOKIE_box_' . $this->boxcode . '_shownb';
            $param_showtot = 'DOLUSERCOOKIE_box_' . $this->boxcode . '_showtot';
            include_once DOL_DOCUMENT_ROOT . '/core/class/dolgraph.class.php';
            include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facturestats.class.php';
            $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
            if (in_array('DOLUSERCOOKIE_box_' . $this->boxcode, $autosetarray)) {
                $endyear = GETPOST($param_year, 'int');
                $shownb = GETPOST($param_shownb, 'alpha');
                $showtot = GETPOST($param_showtot, 'alpha');
            } else {
                $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_' . $this->boxcode], true);
                $endyear = $tmparray['year'];
                $shownb = $tmparray['shownb'];
                $showtot = $tmparray['showtot'];
            }
            if (empty($shownb) && empty($showtot)) {
                $showtot = 1;
            }
            $nowarray = dol_getdate(dol_now(), true);
            if (empty($endyear)) {
                $endyear = $nowarray['year'];
            }
            $startyear = $endyear - 1;
            $mode = 'supplier';
            $WIDTH = $shownb && $showtot || !empty($conf->dol_optimize_smallscreen) ? '256' : '320';
            $HEIGHT = '192';
            $stats = new FactureStats($this->db, $socid, $mode, 0);
            // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
            if ($shownb) {
                $data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, GETPOST('action') == $refreshaction ? -1 : 3600 * 24);
                $filenamenb = $dir . "/" . $prefix . "invoicessuppliernbinyear-" . $year . ".png";
                if ($mode == 'customer') {
                    $fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=billstats&amp;file=invoicesnbinyear-' . $year . '.png';
                }
                if ($mode == 'supplier') {
                    $fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessuppliernbinyear-' . $year . '.png';
                }
                $px1 = new DolGraph();
                $mesg = $px1->isGraphKo();
                if (!$mesg) {
                    $px1->SetData($data1);
                    unset($data1);
                    $px1->SetPrecisionY(0);
                    $i = $startyear;
                    $legend = array();
                    while ($i <= $endyear) {
                        $legend[] = $i;
                        $i++;
                    }
                    $px1->SetLegend($legend);
                    $px1->SetMaxValue($px1->GetCeilMaxValue());
                    $px1->SetWidth($WIDTH);
                    $px1->SetHeight($HEIGHT);
                    $px1->SetYLabel($langs->trans("NumberOfBills"));
                    $px1->SetShading(3);
                    $px1->SetHorizTickIncrement(1);
                    $px1->SetPrecisionY(0);
                    $px1->SetCssPrefix("cssboxes");
                    $px1->mode = 'depth';
                    $px1->SetTitle($langs->trans("NumberOfBillsByMonth"));
                    $px1->draw($filenamenb, $fileurlnb);
                }
            }
            // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
            if ($showtot) {
                $data2 = $stats->getAmountByMonthWithPrevYear($endyear, $startyear, GETPOST('action') == $refreshaction ? -1 : 3600 * 24);
                $filenamenb = $dir . "/" . $prefix . "invoicessupplieramountinyear-" . $year . ".png";
                if ($mode == 'customer') {
                    $fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=billstats&amp;file=invoicesamountinyear-' . $year . '.png';
                }
                if ($mode == 'supplier') {
                    $fileurlnb = DOL_URL_ROOT . '/viewimage.php?modulepart=billstatssupplier&amp;file=invoicessupplieramountinyear-' . $year . '.png';
                }
                $px2 = new DolGraph();
                $mesg = $px2->isGraphKo();
                if (!$mesg) {
                    $px2->SetData($data2);
                    unset($data2);
                    $px2->SetPrecisionY(0);
                    $i = $startyear;
                    $legend = array();
                    while ($i <= $endyear) {
                        $legend[] = $i;
                        $i++;
                    }
                    $px2->SetLegend($legend);
                    $px2->SetMaxValue($px2->GetCeilMaxValue());
                    $px2->SetWidth($WIDTH);
                    $px2->SetHeight($HEIGHT);
                    $px2->SetYLabel($langs->trans("AmountOfBillsHT"));
                    $px2->SetShading(3);
                    $px2->SetHorizTickIncrement(1);
                    $px2->SetPrecisionY(0);
                    $px2->SetCssPrefix("cssboxes");
                    $px2->mode = 'depth';
                    $px2->SetTitle($langs->trans("AmountOfBillsByMonthHT"));
                    $px2->draw($filenamenb, $fileurlnb);
                }
            }
            if (empty($conf->use_javascript_ajax)) {
                $langs->load("errors");
                $mesg = $langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs");
            }
            if (!$mesg) {
                $stringtoshow = '';
                $stringtoshow .= '<script type="text/javascript" language="javascript">
					jQuery(document).ready(function() {
						jQuery("#idsubimg' . $this->boxcode . '").click(function() {
							jQuery("#idfilter' . $this->boxcode . '").toggle();
						});
					});
					</script>';
                $stringtoshow .= '<div class="center hideobject" id="idfilter' . $this->boxcode . '">';
                // hideobject is to start hidden
                $stringtoshow .= '<form class="flat formboxfilter" method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
                $stringtoshow .= '<input type="hidden" name="action" value="' . $refreshaction . '">';
                $stringtoshow .= '<input type="hidden" name="DOL_AUTOSET_COOKIE" value="DOLUSERCOOKIE_box_' . $this->boxcode . ':year,shownb,showtot">';
                $stringtoshow .= '<input type="checkbox" name="' . $param_shownb . '"' . ($shownb ? ' checked' : '') . '> ' . $langs->trans("NumberOfBillsByMonth");
                $stringtoshow .= ' &nbsp; ';
                $stringtoshow .= '<input type="checkbox" name="' . $param_showtot . '"' . ($showtot ? ' checked' : '') . '> ' . $langs->trans("AmountOfBillsByMonthHT");
                $stringtoshow .= '<br>';
                $stringtoshow .= $langs->trans("Year") . ' <input class="flat" size="4" type="text" name="' . $param_year . '" value="' . $endyear . '">';
                $stringtoshow .= '<input type="image" alt="' . $langs->trans("Refresh") . '" src="' . img_picto($langs->trans("Refresh"), 'refresh.png', '', '', 1) . '">';
                $stringtoshow .= '</form>';
                $stringtoshow .= '</div>';
                if ($shownb && $showtot) {
                    $stringtoshow .= '<div class="fichecenter">';
                    $stringtoshow .= '<div class="fichehalfleft">';
                }
                if ($shownb) {
                    $stringtoshow .= $px1->show();
                }
                if ($shownb && $showtot) {
                    $stringtoshow .= '</div>';
                    $stringtoshow .= '<div class="fichehalfright">';
                }
                if ($showtot) {
                    $stringtoshow .= $px2->show();
                }
                if ($shownb && $showtot) {
                    $stringtoshow .= '</div>';
                    $stringtoshow .= '</div>';
                }
                $this->info_box_contents[0][0] = array('td' => 'align="center" class="nohover"', 'textnoformat' => $stringtoshow);
            } else {
                $this->info_box_contents[0][0] = array('td' => 'align="left" class="nohover"', 'maxlength' => 500, 'text' => $mesg);
            }
        } else {
            $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed"));
        }
    }
 }
 // We are on a specific warehouse card, no filter on other should be possible
 print '</td>';
 print '<td class="liste_titre" align="left">';
 if (empty($idproduct) || $idproduct < 0) {
     print '<input class="flat" type="text" size="10" name="search_warehouse_destiny" value="' . $search_warehouse_destiny . '">';
 }
 // We are on a specific warehouse card, no filter on other should be possible
 print '</td>';
 print '<td class="liste_titre" align="left">';
 print '<input class="flat" type="text" size="6" name="search_user" value="' . $search_user . '">';
 print '</td>';
 print '<td class="liste_titre" align="right">';
 print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '">';
 print '&nbsp; ';
 print '<input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'searchclear.png', '', '', 1) . '" name="button_removefilter" value="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '" title="' . dol_escape_htmltag($langs->trans("RemoveFilter")) . '">';
 print '</td>';
 print "</tr>\n";
 print '</form>';
 $arrayofuniqueproduct = array();
 $var = True;
 while ($i < min($num, $conf->liste_limit)) {
     $objp = $db->fetch_object($resql);
     $entrepot_origen = $obj->stock;
     $entrepot_destino = $obj->stock;
     $entrepot_id_origen = $obj->entrepot_id;
     $entrepot_id_destino = $obj->entrepot_id;
     // Checkpoin: evaluar las transferencias
     if (substr($objp->label, 0, 6) == 'Transf') {
         if ((double) $objp->value < 0) {
             $entrepot_origen = $objp->stock;
Beispiel #26
0
     $colspan = 2;
     if (!empty($conf->multicompany->enabled)) {
         $colspan++;
     }
     $num = $db->num_rows($resql);
     print '<table class="noborder" width="100%">';
     print '<tr class="liste_titre"><td colspan="' . $colspan . '">' . $langs->trans("LastGroupsCreated", $num ? $num : $max) . '</td></tr>';
     $var = true;
     $i = 0;
     while ($i < $num && (!$max || $i < $max)) {
         $obj = $db->fetch_object($resql);
         $var = !$var;
         print "<tr " . $bc[$var] . ">";
         print '<td><a href="' . DOL_URL_ROOT . '/user/group/card.php?id=' . $obj->rowid . '">' . img_object($langs->trans("ShowGroup"), "group") . ' ' . $obj->name . '</a>';
         if (!$obj->entity) {
             print img_picto($langs->trans("GlobalGroup"), 'redstar');
         }
         print "</td>";
         if (!empty($conf->multicompany->enabled) && is_object($mc)) {
             $mc->getInfo($obj->entity);
             print '<td>';
             print $mc->label;
             print '</td>';
         }
         print '<td class="nowrap" align="right">' . dol_print_date($db->jdate($obj->datec), 'dayhour') . '</td>';
         print "</tr>";
         $i++;
     }
     print "</table><br>";
     $db->free($resql);
 } else {
Beispiel #27
0
$fulltree = $cate_arbo;
// Define data (format for treeview)
$data = array();
$data[] = array('rowid' => 0, 'fk_menu' => -1, 'title' => "racine", 'mainmenu' => '', 'leftmenu' => '', 'fk_mainmenu' => '', 'fk_leftmenu' => '');
foreach ($fulltree as $key => $val) {
    $categstatic->id = $val['id'];
    $categstatic->ref = $val['label'];
    $categstatic->type = $type;
    $li = $categstatic->getNomUrl(1, '', 60);
    $desc = dol_htmlcleanlastbr($val['description']);
    $data[] = array('rowid' => $val['rowid'], 'fk_menu' => $val['fk_parent'], 'entry' => '<table class="nobordernopadding centpercent"><tr><td>' . $li . '</td><td width="50%">' . dolGetFirstLineOfText($desc) . '</td>' . '<td align="right" width="20px;"><a href="' . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $val['id'] . '&type=' . $type . '">' . img_view() . '</a></td>' . '</tr></table>');
}
print '<table class="liste nohover" width="100%">';
print '<tr class="liste_titre"><td>' . $langs->trans("Categories") . '</td><td></td><td align="right">';
if (!empty($conf->use_javascript_ajax)) {
    print '<div id="iddivjstreecontrol"><a href="#">' . img_picto('', 'object_category') . ' ' . $langs->trans("UndoExpandAll") . '</a> | <a href="#">' . img_picto('', 'object_category-expanded') . ' ' . $langs->trans("ExpandAll") . '</a></div>';
}
print '</td></tr>';
$nbofentries = count($data) - 1;
if ($nbofentries > 0) {
    print '<tr ' . $bc[0] . '><td colspan="3">';
    tree_recur($data, $data[0], 0);
    print '</td></tr>';
} else {
    print '<tr ' . $bc[0] . '>';
    print '<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>' . img_picto_common('', 'treemenu/branchbottom.gif') . '</td>';
    print '<td valign="middle">';
    print $langs->trans("NoCategoryYet");
    print '</td>';
    print '<td>&nbsp;</td>';
    print '</table></td>';
Beispiel #28
0
 }
 if ($deposits) {
     print '+' . price($deposits);
 }
 print '</td>';
 // Remain to pay
 print '<td align="right">' . price($remaintopay) . '</td>';
 $test = price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
 // Amount
 print '<td align="right">';
 // Add remind amount
 $namef = 'amount_' . $objp->facid;
 $nameRemain = 'remain_' . $objp->facid;
 if ($action != 'add_paiement') {
     if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) {
         print img_picto($langs->trans('AddRemind'), 'rightarrow.png', 'id="' . $objp->facid . '" "');
     }
     print '<input type=hidden name="' . $nameRemain . '" value="' . $remaintopay . '">';
     print '<input type="text" size="8" name="' . $namef . '" value="' . $_POST[$namef] . '">';
 } else {
     print '<input type="text" size="8" name="' . $namef . '_disabled" value="' . $_POST[$namef] . '" disabled="true">';
     print '<input type="hidden" name="' . $namef . '" value="' . $_POST[$namef] . '">';
 }
 print "</td>";
 // Warning
 print '<td align="center" width="16">';
 if ($amounts[$invoice->id] && $amounts[$invoice->id] > $amountsresttopay[$invoice->id]) {
     print ' ' . img_warning($langs->trans("PaymentHigherThanReminderToPay"));
 }
 print '</td>';
 print "</tr>\n";
 $num = $db->num_rows($result);
 $i = 0;
 $urladd = "&amp;statut=" . $statut;
 print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, "bons.php", $urladd, $sortfield, $sortorder, '', $num);
 print "\n<!-- debut table -->\n";
 print '<table class="liste" width="100%">';
 print '<tr class="liste_titre">';
 print_liste_field_titre($langs->trans("WithdrawalsReceipts"), "bons.php", "p.ref", '', '', 'class="liste_titre"');
 print_liste_field_titre($langs->trans("Date"), "bons.php", "p.datec", "", "", 'class="liste_titre" align="center"');
 print '<td class="liste_titre" align="right">' . $langs->trans("Amount") . '</td>';
 print '</tr>';
 print '<tr class="liste_titre">';
 print '<form action="bons.php" method="GET">';
 print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="' . $search_line . '" size="10"></td>';
 print '<td class="liste_titre">&nbsp;</td>';
 print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="' . img_picto($langs->trans("Search"), 'search.png', '', '', 1) . '" name="button_search" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '"></td>';
 print '</form>';
 print '</tr>';
 $var = True;
 while ($i < min($num, $conf->liste_limit)) {
     $obj = $db->fetch_object($result);
     $var = !$var;
     print "<tr " . $bc[$var] . "><td>";
     print $bon->LibStatut($obj->statut, 2);
     print "&nbsp;";
     print '<a href="fiche.php?id=' . $obj->rowid . '">' . $obj->ref . "</a></td>\n";
     print '<td align="center">' . dol_print_date($db->jdate($obj->datec), 'day') . "</td>\n";
     print '<td align="right">' . price($obj->amount) . "</td>\n";
     print "</tr>\n";
     $i++;
 }
Beispiel #30
0
     }
 }
 print '</td>';
 // Third party
 print '<td>';
 $companystatic->id = $obj->socid;
 $companystatic->name = $obj->name;
 $companystatic->client = 1;
 print $companystatic->getNomUrl(1, 'customer', 28);
 print '</td>';
 // Start date
 if ($mode == "0") {
     print '<td align="center">';
     print $obj->date_ouverture_prevue ? dol_print_date($db->jdate($obj->date_ouverture_prevue)) : '&nbsp;';
     if ($db->jdate($obj->date_ouverture_prevue) && $db->jdate($obj->date_ouverture_prevue) < $now - $conf->contrat->services->inactifs->warning_delay) {
         print img_picto($langs->trans("Late"), "warning");
     } else {
         print '&nbsp;&nbsp;&nbsp;&nbsp;';
     }
     print '</td>';
 }
 if ($mode == "" || $mode > 0) {
     print '<td align="center">' . ($obj->date_ouverture ? dol_print_date($db->jdate($obj->date_ouverture)) : '&nbsp;') . '</td>';
 }
 // Date fin
 if ($mode == "" || $mode < 5) {
     print '<td align="center">' . ($obj->date_fin_validite ? dol_print_date($db->jdate($obj->date_fin_validite)) : '&nbsp;');
 } else {
     print '<td align="center">' . dol_print_date($db->jdate($obj->date_cloture));
 }
 // Icone warning