Esempio n. 1
0
 static function isInError($type, $ID, $contents = null)
 {
     $msgerr = "";
     $date = date("Y-m-d");
     echo "<td>";
     echo "<span class='plugin_manufacturersimports_import_KO'>";
     echo __('Import failed', 'manufacturersimports') . " (";
     echo Html::convdate($date) . ")</span></td>";
     $temp = new PluginManufacturersimportsLog();
     $temp->deleteByCriteria(array('itemtype' => $type, 'items_id' => $ID));
     //insert base locale
     $values["import_status"] = 2;
     $values["items_id"] = $ID;
     $values["itemtype"] = $type;
     $values["date_import"] = $date;
     $log = new PluginManufacturersimportsLog();
     $log->add($values);
     if (!empty($contents)) {
         $msgerr = __('Connection failed/data download from manufacturer web site', 'manufacturersimports');
     }
     echo "<td>{$msgerr}</td>";
 }
Esempio n. 2
0
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Manufacturersimports is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Manufacturersimports. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
include '../../../inc/includes.php';
header("Content-Type: text/html; charset=UTF-8");
Html::header_nocache();
$log = new PluginManufacturersimportsLog();
$config = new PluginManufacturersimportsConfig();
Html::header(_n('Suppliers import', 'Suppliers imports', 2, 'manufacturersimports'), $_SERVER['PHP_SELF'], "plugins", "manufacturersimports");
$config->checkGlobal("r");
if (isset($_POST["action"]) && isset($_POST["id"]) && isset($_POST["item"]) && count($_POST["item"])) {
    switch ($_POST["action"]) {
        case "import":
            PluginManufacturersimportsPostImport::massiveimport($_POST);
            break;
        case "reinit_once":
            foreach ($_POST["item"] as $key => $val) {
                if ($val == 1) {
                    $log->reinitializeImport($_POST["itemtype"], $key);
                }
            }
            Session::addMessageAfterRedirect(__('Operation successful'));